Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testFindAcquirableJobsWhen0InstancesDeployed()
        public virtual void testFindAcquirableJobsWhen0InstancesDeployed()
        {
            // given
            Assume.assumeTrue(engineRule.ProcessEngineConfiguration.DatabaseType.Equals("oracle"));

            // then
            findAcquirableJobs();
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testFindAcquirableJobsWhen1InstanceDeployed()
        public virtual void testFindAcquirableJobsWhen1InstanceDeployed()
        {
            // given
            Assume.assumeTrue(engineRule.ProcessEngineConfiguration.DatabaseType.Equals("oracle"));
            // when
            testRule.deploy(ProcessModels.ONE_TASK_PROCESS);
            // then
            findAcquirableJobs();
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testRangeMatchInOrderOnRandomValues() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestRangeMatchInOrderOnRandomValues()
        {
            Assume.assumeTrue("Assume support for granular composite queries", TestSuite.supportsGranularCompositeQueries());
            // given
            ValueType[]            types        = RandomSetOfSupportedAndSortableTypes();
            ISet <Value>           uniqueValues = new HashSet <Value>();
            SortedSet <ValueAndId> sortedValues = new SortedSet <ValueAndId>((v1, v2) => Values.COMPARATOR.Compare(v1.value, v2.value));
            MutableLong            nextId       = new MutableLong();

            // A couple of rounds of updates followed by lots of range verifications
            for (int i = 0; i < 5; i++)
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<IndexEntryUpdate<?>> updates = new java.util.ArrayList<>();
                IList <IndexEntryUpdate <object> > updates = new List <IndexEntryUpdate <object> >();
                if (i == 0)
                {
                    // The initial batch of data can simply be additions
                    updates = GenerateUpdatesFromValues(GenerateValuesFromType(types, uniqueValues, 20_000), nextId);
                    sortedValues.addAll(updates.Select(u => new ValueAndId(u.values()[0], u.EntityId)).ToList());
                }
                else
                {
                    // Then do all sorts of updates
                    for (int j = 0; j < 1_000; j++)
                    {
                        int type = Random.intBetween(0, 2);
                        if (type == 0)
                        {                                   // add
                            Value value = GenerateUniqueRandomValue(types, uniqueValues);
                            long  id    = nextId.AndIncrement;
                            sortedValues.Add(new ValueAndId(value, id));
                            updates.Add(add(id, Descriptor.schema(), value));
                        }
                        else if (type == 1)
                        {                                   // update
                            ValueAndId existing = Random.among(sortedValues.toArray(new ValueAndId[0]));
                            sortedValues.remove(existing);
                            Value newValue = GenerateUniqueRandomValue(types, uniqueValues);
                            uniqueValues.remove(existing.Value);
                            sortedValues.Add(new ValueAndId(newValue, existing.Id));
                            updates.Add(change(existing.Id, Descriptor.schema(), existing.Value, newValue));
                        }
                        else
                        {                                   // remove
                            ValueAndId existing = Random.among(sortedValues.toArray(new ValueAndId[0]));
                            sortedValues.remove(existing);
                            uniqueValues.remove(existing.Value);
                            updates.Add(remove(existing.Id, Descriptor.schema(), existing.Value));
                        }
                    }
                }
                UpdateAndCommit(updates);
                VerifyRandomRanges(types, sortedValues);
            }
        }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryWhen0InstancesActive()
        public virtual void testQueryWhen0InstancesActive()
        {
            // given
            Assume.assumeTrue(engineRule.ProcessEngineConfiguration.DatabaseType.Equals("oracle"));

            // then
            IList <VariableInstance> variables = engineRule.RuntimeService.createVariableInstanceQuery().list();

            assertEquals(0, variables.Count);
        }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryWhen1InstanceActive()
        public virtual void testQueryWhen1InstanceActive()
        {
            // given
            Assume.assumeTrue(engineRule.ProcessEngineConfiguration.DatabaseType.Equals("oracle"));
            RuntimeService runtimeService = engineRule.RuntimeService;

            testRule.deploy(ProcessModels.TWO_TASKS_PROCESS);

            // when
            ProcessInstance processInstance    = runtimeService.startProcessInstanceByKey("Process", Variables.createVariables().putValue("foo", "bar"));
            string          activityInstanceId = runtimeService.getActivityInstance(processInstance.Id).Id;

            // then
            IList <VariableInstance> variables = engineRule.RuntimeService.createVariableInstanceQuery().activityInstanceIdIn(activityInstanceId).list();

            assertEquals(1, variables.Count);
        }
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 shouldRejectStoresIfDBIsNotShutdownCleanly() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShouldRejectStoresIfDBIsNotShutdownCleanly()
            {
                // checkpoint has been introduced in 2.3
                Assume.assumeTrue(StandardV2_3.STORE_VERSION.Equals(Version));

                // given
                removeCheckPointFromTxLog(FileSystem, DatabaseLayout.databaseDirectory());
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final UpgradableDatabase upgradableDatabase = getUpgradableDatabase();
                UpgradableDatabase upgradableDatabase = UpgradableDatabase;

                // when
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final boolean result = storeFilesUpgradable(databaseLayout, upgradableDatabase);
                bool result = StoreFilesUpgradable(DatabaseLayout, upgradableDatabase);

                // then
                assertFalse(result);
            }
Ejemplo n.º 7
0
        /*
         * Adds at least 3 1-block properties and removes the first and third.
         * Adds a 2-block property and checks if it is added in the same record.
         */
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testBlockDefragmentationWithTwoSpaces()
        public virtual void TestBlockDefragmentationWithTwoSpaces()
        {
            Assume.assumeTrue(PropertyType.PayloadSizeLongs > 2);
            Node node        = GraphDb.createNode();
            long inUseBefore = PropertyRecordsInUse();

            int stuffedIntegers = 0;

            for ( ; stuffedIntegers < PropertyType.PayloadSizeLongs; stuffedIntegers++)
            {
                node.SetProperty("int" + stuffedIntegers, stuffedIntegers);
            }

            // Basic check that integers take up one (8 byte) block.
            assertEquals(stuffedIntegers, PropertyType.PayloadSizeLongs);
            NewTransaction();

            assertEquals(inUseBefore + 1, PropertyRecordsInUse());

            // Remove first and third
            node.RemoveProperty("int0");
            node.RemoveProperty("int2");
            NewTransaction();
            // Add the two block thing.
            node.SetProperty("theDouble", 1.0);
            NewTransaction();

            // Let's make sure everything is in one record and with proper values.
            assertEquals(inUseBefore + 1, PropertyRecordsInUse());

            assertNull(node.GetProperty("int0", null));
            assertEquals(1, node.GetProperty("int1"));
            assertNull(node.GetProperty("int2", null));
            for (int i = 3; i < stuffedIntegers; i++)
            {
                assertEquals(i, node.GetProperty("int" + i));
            }
            assertEquals(1.0, node.GetProperty("theDouble"));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldTraverseDenseNodeWithoutGroupsWithDetachedReferences() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldTraverseDenseNodeWithoutGroupsWithDetachedReferences()
        {
            Assume.assumeTrue(SupportsDirectTraversal());
            TraverseWithoutGroups(_dense, true);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldTraverseSparseNodeWithoutGroupsWithDetachedReferences() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldTraverseSparseNodeWithoutGroupsWithDetachedReferences()
        {
            Assume.assumeTrue(SupportsSparseNodes());
            TraverseWithoutGroups(_sparse, true);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldTraverseDenseNodeWithoutGroups() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldTraverseDenseNodeWithoutGroups()
        {
            Assume.assumeTrue(SupportsDirectTraversal());
            TraverseWithoutGroups(_dense, false);
        }
Ejemplo n.º 11
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void evaluate() throws Throwable
            public override void evaluate()
            {
                Assume.assumeTrue("ignored because the current history level is too low", hasRequiredHistoryLevel);
                outerInstance.apply(@base, description).evaluate();
            }