Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void createClusterWithNode(org.neo4j.kernel.impl.ha.ClusterManager clusterManager) throws Throwable
        private static void CreateClusterWithNode(ClusterManager clusterManager)
        {
            try
            {
                clusterManager.Start();

                clusterManager.Cluster.await(allSeesAllAsAvailable());

                long nodeId;
                HighlyAvailableGraphDatabase master = clusterManager.Cluster.Master;
                using (Transaction tx = master.BeginTx())
                {
                    Node node = master.CreateNode();
                    nodeId = node.Id;
                    node.SetProperty("foo", "bar");
                    tx.Success();
                }

                HighlyAvailableGraphDatabase slave = clusterManager.Cluster.AnySlave;
                using (Transaction ignored = slave.BeginTx())
                {
                    Node node = slave.GetNodeById(nodeId);
                    assertThat(node.GetProperty("foo").ToString(), CoreMatchers.equalTo("bar"));
                }
            }
            finally
            {
                clusterManager.SafeShutdown();
            }
        }
Ejemplo n.º 2
0
 public virtual void Before()
 {
     Assume.AssumeThat(NativeCodeLoader.IsNativeCodeLoaded() && !Path.Windows, CoreMatchers.EqualTo
                           (true));
     Assume.AssumeThat(DomainSocket.GetLoadingFailureReason(), CoreMatchers.EqualTo(null
                                                                                    ));
 }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testVariableAtConcurrentAndScopeExecutionBecomeNonScope()
        public virtual void testVariableAtConcurrentAndScopeExecutionBecomeNonScope()
        {
            // given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(CONCURRENT_BOUNDARY_TASKS);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.PARALLEL_GATEWAY_PROCESS);

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapEqualActivities().build();

            ProcessInstance processInstance = runtimeService.startProcessInstanceById(sourceProcessDefinition.Id);
            ExecutionTree   executionTreeBeforeMigration = ExecutionTree.forExecution(processInstance.Id, rule.ProcessEngine);

            ExecutionTree scopeExecution      = executionTreeBeforeMigration.getLeafExecutions("userTask1")[0];
            ExecutionTree concurrentExecution = scopeExecution.Parent;

            runtimeService.setVariableLocal(scopeExecution.Id, "foo", 42);
            runtimeService.setVariableLocal(concurrentExecution.Id, "foo", 42);

            // when
            try
            {
                testHelper.migrateProcessInstance(migrationPlan, processInstance);
                Assert.fail("expected exception");
            }
            catch (ProcessEngineException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("The variable 'foo' exists in both, this scope" + " and concurrent local in the parent scope. Migrating to a non-scope activity would overwrite one of them."));
            }
        }
Ejemplo n.º 4
0
        public virtual void TestReadURL()
        {
            HttpURLConnection conn = Org.Mockito.Mockito.Mock <HttpURLConnection>();

            Org.Mockito.Mockito.DoReturn(new ByteArrayInputStream(FakeLogData)).When(conn).GetInputStream
                ();
            Org.Mockito.Mockito.DoReturn(HttpURLConnection.HttpOk).When(conn).GetResponseCode
                ();
            Org.Mockito.Mockito.DoReturn(Sharpen.Extensions.ToString(FakeLogData.Length)).When
                (conn).GetHeaderField("Content-Length");
            URLConnectionFactory factory = Org.Mockito.Mockito.Mock <URLConnectionFactory>();

            Org.Mockito.Mockito.DoReturn(conn).When(factory).OpenConnection(Org.Mockito.Mockito
                                                                            .Any <Uri>(), Matchers.AnyBoolean());
            Uri url = new Uri("http://localhost/fakeLog");
            EditLogInputStream elis = EditLogFileInputStream.FromUrl(factory, url, HdfsConstants
                                                                     .InvalidTxid, HdfsConstants.InvalidTxid, false);
            // Read the edit log and verify that we got all of the data.
            EnumMap <FSEditLogOpCodes, Holder <int> > counts = FSImageTestUtil.CountEditLogOpTypes
                                                                   (elis);

            Assert.AssertThat(counts[FSEditLogOpCodes.OpAdd].held, CoreMatchers.Is(1));
            Assert.AssertThat(counts[FSEditLogOpCodes.OpSetGenstampV1].held, CoreMatchers.Is(
                                  1));
            Assert.AssertThat(counts[FSEditLogOpCodes.OpClose].held, CoreMatchers.Is(1));
            // Check that length header was picked up.
            NUnit.Framework.Assert.AreEqual(FakeLogData.Length, elis.Length());
            elis.Close();
        }
Ejemplo n.º 5
0
        public virtual void TestAddVolumeFailures()
        {
            StartDFSCluster(1, 1);
            string         dataDir    = cluster.GetDataDirectory();
            DataNode       dn         = cluster.GetDataNodes()[0];
            IList <string> newDirs    = Lists.NewArrayList();
            int            NumNewDirs = 4;

            for (int i = 0; i < NumNewDirs; i++)
            {
                FilePath newVolume = new FilePath(dataDir, "new_vol" + i);
                newDirs.AddItem(newVolume.ToString());
                if (i % 2 == 0)
                {
                    // Make addVolume() fail.
                    newVolume.CreateNewFile();
                }
            }
            string newValue = dn.GetConf().Get(DFSConfigKeys.DfsDatanodeDataDirKey) + "," + Joiner
                              .On(",").Join(newDirs);

            try
            {
                dn.ReconfigurePropertyImpl(DFSConfigKeys.DfsDatanodeDataDirKey, newValue);
                NUnit.Framework.Assert.Fail("Expect to throw IOException.");
            }
            catch (ReconfigurationException e)
            {
                string   errorMessage = e.InnerException.Message;
                string[] messages     = errorMessage.Split("\\r?\\n");
                NUnit.Framework.Assert.AreEqual(2, messages.Length);
                Assert.AssertThat(messages[0], CoreMatchers.ContainsString("new_vol0"));
                Assert.AssertThat(messages[1], CoreMatchers.ContainsString("new_vol2"));
            }
            // Make sure that vol0 and vol2's metadata are not left in memory.
            FsDatasetSpi <object> dataset = dn.GetFSDataset();

            foreach (FsVolumeSpi volume in dataset.GetVolumes())
            {
                Assert.AssertThat(volume.GetBasePath(), IS.Is(CoreMatchers.Not(CoreMatchers.AnyOf
                                                                                   (IS.Is(newDirs[0]), IS.Is(newDirs[2])))));
            }
            DataStorage storage = dn.GetStorage();

            for (int i_1 = 0; i_1 < storage.GetNumStorageDirs(); i_1++)
            {
                Storage.StorageDirectory sd = storage.GetStorageDir(i_1);
                Assert.AssertThat(sd.GetRoot().ToString(), IS.Is(CoreMatchers.Not(CoreMatchers.AnyOf
                                                                                      (IS.Is(newDirs[0]), IS.Is(newDirs[2])))));
            }
            // The newly effective conf does not have vol0 and vol2.
            string[] effectiveVolumes = dn.GetConf().Get(DFSConfigKeys.DfsDatanodeDataDirKey)
                                        .Split(",");
            NUnit.Framework.Assert.AreEqual(4, effectiveVolumes.Length);
            foreach (string ev in effectiveVolumes)
            {
                Assert.AssertThat(StorageLocation.Parse(ev).GetFile().GetCanonicalPath(), IS.Is(CoreMatchers.Not
                                                                                                    (CoreMatchers.AnyOf(IS.Is(newDirs[0]), IS.Is(newDirs[2])))));
            }
        }
Ejemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleDeletedRelationships() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHandleDeletedRelationships()
        {
            // When
            Connection.connect(_address).send(Util.defaultAcceptedVersions()).send(Util.chunk(new InitMessage("TestClient/1.1", emptyMap()), new RunMessage("CREATE ()-[r:T {prop: 42}]->() DELETE r RETURN r"), PullAllMessage.INSTANCE));

            // Then
            assertThat(Connection, Util.eventuallyReceivesSelectedProtocolVersion());
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.hamcrest.Matcher<java.util.Map<? extends String,?>> entryFieldsMatcher = hasEntry(is("fields"), equalTo(singletonList("r")));
            Matcher <IDictionary <string, ?> > entryFieldsMatcher = hasEntry(@is("fields"), equalTo(singletonList("r")));

            assertThat(Connection, Util.eventuallyReceives(msgSuccess(), msgSuccess(CoreMatchers.allOf(entryFieldsMatcher, hasKey("result_available_after")))));

            //
            //Record(0x71) {
            //    fields: [ Relationship(0x52) {
            //                 relId: 00
            //                 startId: 00
            //                 endId: 01
            //                 type: "T" (81 54)
            //                 props: {} (A0)]
            //}
            assertThat(Connection, eventuallyReceives(Bytes(0x00, 0x0B, 0xB1, 0x71, 0x91, 0xB5, 0x52, 0x00, 0x00, 0x01, 0x81, 0x54, 0xA0, 0x00, 0x00)));
            assertThat(Connection, Util.eventuallyReceives(msgSuccess()));
        }
Ejemplo n.º 7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected static java.util.Map<String, Object> deserializeMap(final String body) throws org.neo4j.server.rest.domain.JsonParseException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        protected internal static IDictionary <string, object> DeserializeMap(string body)
        {
            IDictionary <string, object> result = JsonHelper.jsonToMap(body);

            assertThat(result, CoreMatchers.@is(not(nullValue())));
            return(result);
        }
Ejemplo n.º 8
0
        public virtual void TestBlockIdGeneration()
        {
            Configuration conf = new HdfsConfiguration();

            conf.SetInt(DFSConfigKeys.DfsReplicationKey, 1);
            MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(1).Build();

            try
            {
                cluster.WaitActive();
                FileSystem fs = cluster.GetFileSystem();
                // Create a file that is 10 blocks long.
                Path path = new Path("testBlockIdGeneration.dat");
                DFSTestUtil.CreateFile(fs, path, IoSize, BlockSize * 10, BlockSize, Replication,
                                       Seed);
                IList <LocatedBlock> blocks = DFSTestUtil.GetAllBlocks(fs, path);
                Log.Info("Block0 id is " + blocks[0].GetBlock().GetBlockId());
                long nextBlockExpectedId = blocks[0].GetBlock().GetBlockId() + 1;
                // Ensure that the block IDs are sequentially increasing.
                for (int i = 1; i < blocks.Count; ++i)
                {
                    long nextBlockId = blocks[i].GetBlock().GetBlockId();
                    Log.Info("Block" + i + " id is " + nextBlockId);
                    Assert.AssertThat(nextBlockId, CoreMatchers.Is(nextBlockExpectedId));
                    ++nextBlockExpectedId;
                }
            }
            finally
            {
                cluster.Shutdown();
            }
        }
Ejemplo n.º 9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static java.util.List<java.util.Map<String, Object>> deserializeList(final String body) throws org.neo4j.server.rest.domain.JsonParseException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        private static IList <IDictionary <string, object> > DeserializeList(string body)
        {
            IList <IDictionary <string, object> > result = JsonHelper.jsonToList(body);

            assertThat(result, CoreMatchers.@is(not(nullValue())));
            return(result);
        }
Ejemplo n.º 10
0
 public virtual void TestShortCircuitReadMetaFileCorruption()
 {
     Assume.AssumeThat(DomainSocket.GetLoadingFailureReason(), CoreMatchers.EqualTo(null
                                                                                    ));
     StartUpCluster(true, 1 + EvictionLowWatermark, true, false);
     DoShortCircuitReadMetaFileCorruptionTest();
 }
Ejemplo n.º 11
0
        public virtual void TestAsyncReconfigure()
        {
            TestReconfiguration.AsyncReconfigurableDummy dummy = Org.Mockito.Mockito.Spy(new
                                                                                         TestReconfiguration.AsyncReconfigurableDummy(conf1));
            IList <ReconfigurationUtil.PropertyChange> changes = Lists.NewArrayList();

            changes.AddItem(new ReconfigurationUtil.PropertyChange("name1", "new1", "old1"));
            changes.AddItem(new ReconfigurationUtil.PropertyChange("name2", "new2", "old2"));
            changes.AddItem(new ReconfigurationUtil.PropertyChange("name3", "new3", "old3"));
            Org.Mockito.Mockito.DoReturn(changes).When(dummy).GetChangedProperties(Matchers.Any
                                                                                   <Configuration>(), Matchers.Any <Configuration>());
            Org.Mockito.Mockito.DoReturn(true).When(dummy).IsPropertyReconfigurable(Matchers.Eq
                                                                                        ("name1"));
            Org.Mockito.Mockito.DoReturn(false).When(dummy).IsPropertyReconfigurable(Matchers.Eq
                                                                                         ("name2"));
            Org.Mockito.Mockito.DoReturn(true).When(dummy).IsPropertyReconfigurable(Matchers.Eq
                                                                                        ("name3"));
            Org.Mockito.Mockito.DoNothing().When(dummy).ReconfigurePropertyImpl(Matchers.Eq("name1"
                                                                                            ), Matchers.AnyString());
            Org.Mockito.Mockito.DoNothing().When(dummy).ReconfigurePropertyImpl(Matchers.Eq("name2"
                                                                                            ), Matchers.AnyString());
            Org.Mockito.Mockito.DoThrow(new ReconfigurationException("NAME3", "NEW3", "OLD3",
                                                                     new IOException("io exception"))).When(dummy).ReconfigurePropertyImpl(Matchers.Eq
                                                                                                                                               ("name3"), Matchers.AnyString());
            dummy.StartReconfigurationTask();
            WaitAsyncReconfigureTaskFinish(dummy);
            ReconfigurationTaskStatus status = dummy.GetReconfigurationTaskStatus();

            Assert.Equal(3, status.GetStatus().Count);
            foreach (KeyValuePair <ReconfigurationUtil.PropertyChange, Optional <string> > result
                     in status.GetStatus())
            {
                ReconfigurationUtil.PropertyChange change = result.Key;
                if (change.prop.Equals("name1"))
                {
                    NUnit.Framework.Assert.IsFalse(result.Value.IsPresent());
                }
                else
                {
                    if (change.prop.Equals("name2"))
                    {
                        MatcherAssert.AssertThat(result.Value.Get(), CoreMatchers.ContainsString("Property name2 is not reconfigurable"
                                                                                                 ));
                    }
                    else
                    {
                        if (change.prop.Equals("name3"))
                        {
                            MatcherAssert.AssertThat(result.Value.Get(), CoreMatchers.ContainsString("io exception"
                                                                                                     ));
                        }
                        else
                        {
                            NUnit.Framework.Assert.Fail("Unknown property: " + change.prop);
                        }
                    }
                }
            }
        }
        /// <exception cref="System.IO.IOException"/>
        private LocatedBlock GetLocatedBlock()
        {
            LocatedBlocks locatedBlocks = client.GetLocatedBlocks(Path.ToString(), 0, BlockSize
                                                                  );

            Assert.AssertThat(locatedBlocks.GetLocatedBlocks().Count, CoreMatchers.Is(1));
            return(Iterables.GetOnlyElement(locatedBlocks.GetLocatedBlocks()));
        }
Ejemplo n.º 13
0
 internal virtual void AssertProcSucceeds(Driver driver)
 {
     using (Session session = driver.session())
     {
         Value single = session.run("CALL test.staticReadProcedure()").single().get(0);
         assertThat(single.asString(), CoreMatchers.equalTo("static"));
     }
 }
Ejemplo n.º 14
0
 internal virtual void AssertWriteSucceeds(Driver driver)
 {
     using (Session session = driver.session())
     {
         StatementResult result = session.run("CREATE ()");
         assertThat(result.summary().counters().nodesCreated(), CoreMatchers.equalTo(1));
     }
 }
Ejemplo n.º 15
0
 internal virtual void AssertAuth(AuthToken authToken)
 {
     using (Driver driver = ConnectDriver(authToken), Session session = driver.session())
     {
         Value single = session.run("RETURN 1").single().get(0);
         assertThat(single.asLong(), CoreMatchers.equalTo(1L));
     }
 }
Ejemplo n.º 16
0
 internal virtual void AssertAuth(string username, string password, string realm)
 {
     using (Driver driver = ConnectDriver(username, password, realm), Session session = driver.session())
     {
         Value single = session.run("RETURN 1").single().get(0);
         assertThat(single.asLong(), CoreMatchers.equalTo(1L));
     }
 }
Ejemplo n.º 17
0
        /// <exception cref="System.Exception"/>
        public virtual void TestDataDirParsing()
        {
            Configuration           conf = new Configuration();
            IList <StorageLocation> locations;
            FilePath dir0 = new FilePath("/dir0");
            FilePath dir1 = new FilePath("/dir1");
            FilePath dir2 = new FilePath("/dir2");
            FilePath dir3 = new FilePath("/dir3");
            FilePath dir4 = new FilePath("/dir4");
            // Verify that a valid string is correctly parsed, and that storage
            // type is not case-sensitive
            string locations1 = "[disk]/dir0,[DISK]/dir1,[sSd]/dir2,[disK]/dir3,[ram_disk]/dir4";

            conf.Set(DFSConfigKeys.DfsDatanodeDataDirKey, locations1);
            locations = DataNode.GetStorageLocations(conf);
            Assert.AssertThat(locations.Count, CoreMatchers.Is(5));
            Assert.AssertThat(locations[0].GetStorageType(), CoreMatchers.Is(StorageType.Disk
                                                                             ));
            Assert.AssertThat(locations[0].GetUri(), CoreMatchers.Is(dir0.ToURI()));
            Assert.AssertThat(locations[1].GetStorageType(), CoreMatchers.Is(StorageType.Disk
                                                                             ));
            Assert.AssertThat(locations[1].GetUri(), CoreMatchers.Is(dir1.ToURI()));
            Assert.AssertThat(locations[2].GetStorageType(), CoreMatchers.Is(StorageType.Ssd)
                              );
            Assert.AssertThat(locations[2].GetUri(), CoreMatchers.Is(dir2.ToURI()));
            Assert.AssertThat(locations[3].GetStorageType(), CoreMatchers.Is(StorageType.Disk
                                                                             ));
            Assert.AssertThat(locations[3].GetUri(), CoreMatchers.Is(dir3.ToURI()));
            Assert.AssertThat(locations[4].GetStorageType(), CoreMatchers.Is(StorageType.RamDisk
                                                                             ));
            Assert.AssertThat(locations[4].GetUri(), CoreMatchers.Is(dir4.ToURI()));
            // Verify that an unrecognized storage type result in an exception.
            string locations2 = "[BadMediaType]/dir0,[ssd]/dir1,[disk]/dir2";

            conf.Set(DFSConfigKeys.DfsDatanodeDataDirKey, locations2);
            try
            {
                locations = DataNode.GetStorageLocations(conf);
                NUnit.Framework.Assert.Fail();
            }
            catch (ArgumentException iae)
            {
                DataNode.Log.Info("The exception is expected.", iae);
            }
            // Assert that a string with no storage type specified is
            // correctly parsed and the default storage type is picked up.
            string locations3 = "/dir0,/dir1";

            conf.Set(DFSConfigKeys.DfsDatanodeDataDirKey, locations3);
            locations = DataNode.GetStorageLocations(conf);
            Assert.AssertThat(locations.Count, CoreMatchers.Is(2));
            Assert.AssertThat(locations[0].GetStorageType(), CoreMatchers.Is(StorageType.Disk
                                                                             ));
            Assert.AssertThat(locations[0].GetUri(), CoreMatchers.Is(dir0.ToURI()));
            Assert.AssertThat(locations[1].GetStorageType(), CoreMatchers.Is(StorageType.Disk
                                                                             ));
            Assert.AssertThat(locations[1].GetUri(), CoreMatchers.Is(dir1.ToURI()));
        }
 private void ValidateStorageState(StorageReport[] storageReports, DatanodeStorage.State
                                   state)
 {
     foreach (StorageReport storageReport in storageReports)
     {
         DatanodeStorage storage = storageReport.GetStorage();
         Assert.AssertThat(storage.GetState(), CoreMatchers.Is(state));
     }
 }
Ejemplo n.º 19
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReturnCorrectArrayType()
        public virtual void ShouldReturnCorrectArrayType()
        {
            // Given
            Db.execute("CREATE (p:Person {names:['adsf', 'adf' ]})");

            // When
            object result = Db.execute("MATCH (n) RETURN n.names").next().get("n.names");

            // Then
            assertThat(result, CoreMatchers.instanceOf(typeof(string[])));
        }
Ejemplo n.º 20
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleBadCredentialsInAuthorizationRequest() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHandleBadCredentialsInAuthorizationRequest()
        {
            // given
            HttpCopier copier = new HttpCopier(new ControlledOutsideWorld(_fs));
            Path       source = CreateDump();

            WireMock.stubFor(AuthenticationRequest(false).willReturn(aResponse().withStatus(HTTP_UNAUTHORIZED)));

            // when/then
            AssertThrows(typeof(CommandFailed), CoreMatchers.equalTo("Invalid username/password credentials"), () => authenticateAndCopy(copier, source, "user", "pass".ToCharArray()));
        }
Ejemplo n.º 21
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHandleAuthenticateMovedRoute() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHandleAuthenticateMovedRoute()
        {
            // given
            HttpCopier copier = new HttpCopier(new ControlledOutsideWorld(_fs));
            Path       source = CreateDump();

            WireMock.stubFor(AuthenticationRequest(false).willReturn(aResponse().withStatus(HTTP_NOT_FOUND)));

            // when/then
            AssertThrows(typeof(CommandFailed), CoreMatchers.containsString("please contact support"), () => authenticateAndCopy(copier, source, "user", "pass".ToCharArray()));
        }
Ejemplo n.º 22
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testNullMigrationPlan()
        public virtual void testNullMigrationPlan()
        {
            try
            {
                runtimeService.newMigration(null).processInstanceIds(System.Linq.Enumerable.Empty <string>()).execute();
                fail("Should not be able to migrate");
            }
            catch (ProcessEngineException e)
            {
                assertThat(e.Message, CoreMatchers.containsString("migration plan is null"));
            }
        }
Ejemplo n.º 23
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryOrderWithoutOrderingProperty()
        public virtual void testQueryOrderWithoutOrderingProperty()
        {
            try
            {
                managementService.createBatchStatisticsQuery().asc().list();
                Assert.fail("exception expected");
            }
            catch (NotValidException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("You should call any of the orderBy methods " + "first before specifying a direction"));
            }
        }
Ejemplo n.º 24
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryOrderingPropertyWithoutOrder()
        public virtual void testQueryOrderingPropertyWithoutOrder()
        {
            try
            {
                managementService.createBatchStatisticsQuery().orderById().list();
                Assert.fail("exception expected");
            }
            catch (NotValidException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("Invalid query: " + "call asc() or desc() after using orderByXX()"));
            }
        }
Ejemplo n.º 25
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByNullType()
        public virtual void testQueryByNullType()
        {
            try
            {
                managementService.createBatchStatisticsQuery().type(null).list();
                Assert.fail("exception expected");
            }
            catch (NullValueException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("Type is null"));
            }
        }
Ejemplo n.º 26
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBatchQueryOrderWithoutOrderingProperty()
        public virtual void testBatchQueryOrderWithoutOrderingProperty()
        {
            try
            {
                historyService.createHistoricBatchQuery().asc().singleResult();
                Assert.fail("exception expected");
            }
            catch (NotValidException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("You should call any of the orderBy methods " + "first before specifying a direction"));
            }
        }
Ejemplo n.º 27
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBatchQueryOrderingPropertyWithoutOrder()
        public virtual void testBatchQueryOrderingPropertyWithoutOrder()
        {
            try
            {
                historyService.createHistoricBatchQuery().orderById().singleResult();
                Assert.fail("exception expected");
            }
            catch (NotValidException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("Invalid query: " + "call asc() or desc() after using orderByXX()"));
            }
        }
Ejemplo n.º 28
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBatchQueryByTypeNull()
        public virtual void testBatchQueryByTypeNull()
        {
            try
            {
                historyService.createHistoricBatchQuery().type(null).singleResult();
                Assert.fail("exception expected");
            }
            catch (NullValueException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("Type is null"));
            }
        }
Ejemplo n.º 29
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByNullJobDefinitionIds()
        public virtual void testQueryByNullJobDefinitionIds()
        {
            try
            {
                runtimeService.createIncidentQuery().jobDefinitionIdIn((string[])null);
                fail("Should fail");
            }
            catch (NullValueException e)
            {
                assertThat(e.Message, CoreMatchers.containsString("jobDefinitionIds is null"));
            }
        }
Ejemplo n.º 30
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBatchQueryByIdNull()
        public virtual void testBatchQueryByIdNull()
        {
            try
            {
                managementService.createBatchQuery().batchId(null).singleResult();
                Assert.fail("exception expected");
            }
            catch (NullValueException e)
            {
                Assert.assertThat(e.Message, CoreMatchers.containsString("Batch id is null"));
            }
        }