Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* This software is subject to the terms of the Eclipse Public License v1.0
* Agreement, available at the following URL:
* http://www.eclipse.org/legal/epl-v10.html.
* You must accept the terms of that agreement to use this software.
*
* Copyright (C) 2002-2017 Hitachi Vantara and others
* All Rights Reserved.
*
* ---- All changes after Fork in 2023 ------------------------
*
* Project: Eclipse daanse
*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors after Fork in 2023:
* SmartCity Jena - initial
*/
package org.eclipse.daanse.olap.calc.base.type.tuplebase;

import static org.junit.jupiter.api.Assertions.assertTrue;

import org.eclipse.daanse.olap.api.calc.todo.TupleList;
import org.junit.jupiter.api.Test;

/**
* Unit test for {@link TupleList} and common implementations.
*
* @author jhyde
*/
class TupleListTest {

@Test
void testTupleList() {
assertTrue(TupleCollections.createList(1) instanceof UnaryTupleList);
assertTrue(TupleCollections.createList(2) instanceof ArrayTupleList);
}
}
81 changes: 81 additions & 0 deletions common/src/test/java/org/eclipse/daanse/olap/fun/SortTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* This software is subject to the terms of the Eclipse Public License v1.0
* Agreement, available at the following URL:
* http://www.eclipse.org/legal/epl-v10.html.
* You must accept the terms of that agreement to use this software.
*
* Copyright (c) 2002-2020 Hitachi Vantara.. All rights reserved.
*
* ---- All changes after Fork in 2023 ------------------------
*
* Project: Eclipse daanse
*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors after Fork in 2023:
* SmartCity Jena - initial
*/
package org.eclipse.daanse.olap.fun;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.eclipse.daanse.olap.common.SystemWideProperties;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;


/**
* <code>SortTest</code> tests the collation order of positive and negative
* infinity, and {@link Double#NaN}.
*
* @author jhyde
* @since Sep 21, 2006
*/
class SortTest {

/**
* Access properties via this object and their values will be reset.
*/

@AfterEach
public void afterEach() {
SystemWideProperties.instance().populateInitial();
}

@Test
void testFoo() {
// Check that each value compares according to its position in the total
// order. For example, NaN compares greater than
// Double.NEGATIVE_INFINITY, -34.5, -0.001, 0, 0.00000567, 1, 3.14;
// equal to NaN; and less than Double.POSITIVE_INFINITY.
double[] values = {
Double.NEGATIVE_INFINITY,
FunUtil.DOUBLE_NULL,
-34.5,
-0.001,
0,
0.00000567,
1,
3.14,
Double.NaN,
Double.POSITIVE_INFINITY,
};
for ( int i = 0; i < values.length; i++ ) {
for ( int j = 0; j < values.length; j++ ) {
int expected = Integer.compare( i, j );
assertEquals(
expected,
FunUtil.compareValues( values[ i ], values[ j ] ),
"values[" + i + "]=" + values[ i ] + ", values[" + j
+ "]=" + values[ j ]);
}
}
}

}
Loading
Loading