fix sonarlint messages

This commit is contained in:
2021-01-09 23:24:00 +01:00
parent 6c8e149be2
commit 916215c0c2
15 changed files with 278 additions and 275 deletions

View File

@ -5,11 +5,12 @@ Bundle-SymbolicName: com.minres.scviewer.database.test
Bundle-Version: 1.0.1.qualifier
Bundle-Vendor: MINRES Technologies GmbH
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit,
com.minres.scviewer.database,
Require-Bundle: com.minres.scviewer.database,
com.minres.scviewer.database.sqlite;bundle-version="1.0.0",
com.minres.scviewer.database.text;bundle-version="1.0.0",
com.minres.scviewer.database.vcd;bundle-version="1.0.0"
com.minres.scviewer.database.vcd;bundle-version="1.0.0",
org.junit,
org.junit.jupiter.api
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/component.xml
Automatic-Module-Name: com.minres.scviewer.database.test

View File

@ -17,22 +17,15 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.util.List;
import java.util.Map.Entry;
import java.util.NavigableMap;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.minres.scviewer.database.AssociationType;
import com.minres.scviewer.database.DataType;
import com.minres.scviewer.database.EventKind;
import com.minres.scviewer.database.IEvent;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.IWaveformDb;
import com.minres.scviewer.database.IWaveformDbFactory;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxAttribute;
import com.minres.scviewer.database.tx.ITxEvent;
public class DatabaseServicesTest {
@ -127,37 +120,6 @@ public class DatabaseServicesTest {
assertEquals(1, waveformDb.getChildNodes().size());
}
//@Test
public void testTxLDb() throws Exception {
File f = new File("inputs/my_ldb.txldb").getAbsoluteFile();
assertTrue(f.exists());
waveformDb.load(f);
assertNotNull(waveformDb);
assertEquals(1, waveformDb.getChildNodes().size());
List<IWaveform> waves = waveformDb.getAllWaves();
assertEquals(3, waves.size());
IWaveform stream = waves.get(0);
NavigableMap<Long, IEvent[]> eventsList = stream.getEvents();
assertEquals(27, eventsList.size());
Entry<Long, IEvent[]> eventEntry = eventsList.firstEntry();
assertEquals(100000000L, (long) eventEntry.getKey());
IEvent[] events = eventEntry.getValue();
assertEquals(1, events.length);
IEvent event = events[0];
assertEquals(EventKind.BEGIN, event.getKind());
assertTrue(event instanceof ITxEvent);
ITx tx = ((ITxEvent)event).getTransaction();
assertEquals(3L, (long) tx.getId());
List<ITxAttribute> attrs = tx.getAttributes();
assertEquals(1, attrs.size());
ITxAttribute attr = attrs.get(0);
assertEquals("data", attr.getName());
assertEquals(DataType.UNSIGNED, attr.getDataType());
assertEquals(AssociationType.END, attr.getType());
assertTrue(attr.getValue() instanceof Integer);
assertEquals(0, (int) attr.getValue());
}
@Test
public void testHierarchicalVCD() throws Exception {
File f = new File("inputs/simple_system.vcd").getAbsoluteFile();