Skip to content
Permalink
Browse files

test: Initialize RosterConfigManager where needed

  • Loading branch information...
rhwood committed Aug 6, 2019
1 parent 65e9329 commit 2b3714ea549c9d2e498d8769e9f8b67f6fb45a60
@@ -8,21 +8,21 @@

/**
*
* @author Paul Bender Copyright (C) 2017
* @author Paul Bender Copyright (C) 2017
*/
public class RosterRecorderTest {

@Test
public void testCTor() {
RosterRecorder t = new RosterRecorder();
Assert.assertNotNull("exists",t);
Assert.assertNotNull("exists", t);
}

// The minimal setup for log4J
@Before
public void setUp() {
JUnitUtil.setUp();
jmri.util.JUnitUtil.resetProfileManager();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
}

@After
@@ -31,5 +31,4 @@ public void tearDown() {
}

// private final static Logger log = LoggerFactory.getLogger(RosterRecorderTest.class);

}
@@ -8,21 +8,21 @@

/**
*
* @author Paul Bender Copyright (C) 2017
* @author Paul Bender Copyright (C) 2017
*/
public class RosterEntrySelectorPanelTest {

@Test
public void testCTor() {
RosterEntrySelectorPanel t = new RosterEntrySelectorPanel();
Assert.assertNotNull("exists",t);
Assert.assertNotNull("exists", t);
}

// The minimal setup for log4J
@Before
public void setUp() {
JUnitUtil.setUp();
jmri.util.JUnitUtil.resetProfileManager();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
}

@After
@@ -31,5 +31,4 @@ public void tearDown() {
}

// private final static Logger log = LoggerFactory.getLogger(RosterEntrySelectorPanelTest.class);

}
@@ -8,21 +8,22 @@

/**
*
* @author Paul Bender Copyright (C) 2017
* @author Paul Bender Copyright (C) 2017
*/
public class RosterGroupComboBoxTest {

@Test
public void testCTor() {
RosterGroupComboBox t = new RosterGroupComboBox();
Assert.assertNotNull("exists",t);
Assert.assertNotNull("exists", t);
}

// The minimal setup for log4J
@Before
public void setUp() {
JUnitUtil.setUp();
jmri.util.JUnitUtil.resetProfileManager();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
}

@After
@@ -31,5 +32,4 @@ public void tearDown() {
}

// private final static Logger log = LoggerFactory.getLogger(RosterGroupComboBoxTest.class);

}
@@ -65,10 +65,7 @@ public void setUp() {
jmri.util.JUnitUtil.setUp();

jmri.util.JUnitUtil.resetProfileManager();

// Create empty test instance
InstanceManager.reset(Roster.class);
InstanceManager.setDefault(Roster.class, new Roster());
JUnitUtil.initRosterConfigManager();

// first entry
Element e;
@@ -18,12 +18,12 @@ public void testCTor() {
Assert.assertNotNull("exists",t);
}

// The minimal setup for log4J
@Before
public void setUp() {
JUnitUtil.setUp();
jmri.util.JUnitUtil.resetProfileManager();
jmri.util.JUnitUtil.initDefaultUserMessagePreferences();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
JUnitUtil.initDefaultUserMessagePreferences();
}

@After
@@ -12,34 +12,34 @@

/**
*
* @author Paul Bender Copyright (C) 2017
* @author Paul Bender Copyright (C) 2017
*/
public class CombinedLocoSelPaneTest {

@Test
public void testCTor() {
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl,pmp);
Assert.assertNotNull("exists",t);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl, pmp);
Assert.assertNotNull("exists", t);
}

@Test
public void testLayoutRosterSelection() {
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl,pmp);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl, pmp);
JPanel panel = t.layoutRosterSelection();
Assert.assertNotNull("Roster Selection Panel Created",panel);
Assert.assertNotNull("Roster Selection Panel Created", panel);
}

@Test
public void testCreateProgrammerSelection() {
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl,pmp);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl, pmp);
JPanel panel = t.createProgrammerSelection();
Assert.assertNotNull("Programmer Selection Panel Created",panel);
Assert.assertNotNull("Programmer Selection Panel Created", panel);
}

@Test
@@ -48,7 +48,7 @@ public void testSelectLocoAddressNotInRoster() {
// key. in the selectLoco method.
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl,pmp);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl, pmp);
t.selectLoco(1234);
JUnitAppender.assertWarnMessage("Read address 1234, but no such loco in roster");
}
@@ -57,7 +57,7 @@ public void testSelectLocoAddressNotInRoster() {
public void testStartIdentifyLoco() {
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl,pmp);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl, pmp);
t.startIdentifyLoco();
JUnitAppender.assertWarnMessage("Selector did not provide a programmer, use default");
}
@@ -66,7 +66,7 @@ public void testStartIdentifyLoco() {
public void testStartIdentifyDecoder() {
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl,pmp);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl, pmp);
t.startIdentifyDecoder();
JUnitAppender.assertWarnMessage("Selector did not provide a programmer, use default");
}
@@ -77,8 +77,8 @@ public void testSelectDecoder() {
// key. in the selectLoco method.
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl,pmp);
t.selectDecoder(13,123,-1);
CombinedLocoSelPane t = new CombinedLocoSelPane(jl, pmp);
t.selectDecoder(13, 123, -1);
JUnitAppender.assertWarnMessage("Found mfg 13 (Public-domain and DIY) version 123; no such decoder defined");
}

@@ -88,7 +88,8 @@ public void setUp() {
JUnitUtil.setUp();
JUnitUtil.resetInstanceManager();
JUnitUtil.resetProfileManager();
jmri.InstanceManager.setDefault(ProgrammerConfigManager.class,new ProgrammerConfigManager());
JUnitUtil.initRosterConfigManager();
jmri.InstanceManager.setDefault(ProgrammerConfigManager.class, new ProgrammerConfigManager());
}

@After
@@ -99,5 +100,4 @@ public void tearDown() {
}

// private final static Logger log = LoggerFactory.getLogger(CombinedLocoSelPaneTest.class);

}
@@ -6,45 +6,45 @@
import org.junit.Test;
import jmri.jmrit.progsupport.ProgModePane;
import javax.swing.JLabel;
import jmri.InstanceManager;
import jmri.util.JUnitUtil;

/**
*
* @author Paul Bender Copyright (C) 2017
* @author Paul Bender Copyright (C) 2017
*/
public class KnownLocoSelPaneTest {

@Test
public void testCTor() {
JLabel jl = new JLabel("test selector");
ProgModePane pmp = new ProgModePane(javax.swing.BoxLayout.X_AXIS);
KnownLocoSelPane t = new KnownLocoSelPane(jl,false,pmp);
Assert.assertNotNull("exists",t);
KnownLocoSelPane t = new KnownLocoSelPane(jl, false, pmp);
Assert.assertNotNull("exists", t);
}

@Test
public void testBooleanCTor() {
new JLabel("test selector");
new ProgModePane(javax.swing.BoxLayout.X_AXIS);
KnownLocoSelPane t = new KnownLocoSelPane(false);
Assert.assertNotNull("exists",t);
Assert.assertNotNull("exists", t);
}

// The minimal setup for log4J
@Before
public void setUp() {
jmri.util.JUnitUtil.setUp();
jmri.util.JUnitUtil.resetInstanceManager();
jmri.util.JUnitUtil.resetProfileManager();
jmri.InstanceManager.setDefault(ProgrammerConfigManager.class,new ProgrammerConfigManager());
JUnitUtil.setUp();
JUnitUtil.resetInstanceManager();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
InstanceManager.setDefault(ProgrammerConfigManager.class, new ProgrammerConfigManager());
}

@After
public void tearDown() {
jmri.util.JUnitUtil.resetInstanceManager();
JUnitUtil.resetInstanceManager();
jmri.util.JUnitUtil.tearDown();

}

// private final static Logger log = LoggerFactory.getLogger(KnownLocoSelPaneTest.class);

}
@@ -6,6 +6,8 @@
import org.junit.Test;
import jmri.jmrit.progsupport.ProgModePane;
import javax.swing.JLabel;
import jmri.InstanceManager;
import jmri.util.JUnitUtil;

/**
*
@@ -24,16 +26,17 @@ public void testCTor() {
// The minimal setup for log4J
@Before
public void setUp() {
jmri.util.JUnitUtil.setUp();
jmri.util.JUnitUtil.resetInstanceManager();
jmri.util.JUnitUtil.resetProfileManager();
jmri.InstanceManager.setDefault(ProgrammerConfigManager.class,new ProgrammerConfigManager());
JUnitUtil.setUp();
JUnitUtil.resetInstanceManager();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
InstanceManager.setDefault(ProgrammerConfigManager.class,new ProgrammerConfigManager());
}

@After
public void tearDown() {
jmri.util.JUnitUtil.resetInstanceManager();
jmri.util.JUnitUtil.tearDown();
JUnitUtil.resetInstanceManager();
JUnitUtil.tearDown();

}

@@ -8,21 +8,22 @@

/**
*
* @author Paul Bender Copyright (C) 2017
* @author Paul Bender Copyright (C) 2017
*/
public class NewLocoSelPaneTest {

@Test
public void testCTor() {
NewLocoSelPane t = new NewLocoSelPane();
Assert.assertNotNull("exists",t);
Assert.assertNotNull("exists", t);
}

// The minimal setup for log4J
@Before
public void setUp() {
JUnitUtil.setUp();
jmri.util.JUnitUtil.resetProfileManager();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
}

@After
@@ -31,5 +32,4 @@ public void tearDown() {
}

// private final static Logger log = LoggerFactory.getLogger(NewLocoSelPaneTest.class);

}
@@ -21,13 +21,13 @@ public void testCtor() {

@Before
public void setUp() throws Exception {
jmri.util.JUnitUtil.setUp();

JUnitUtil.setUp();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
}

@After
public void tearDown() throws Exception {
jmri.util.JUnitUtil.tearDown();
JUnitUtil.tearDown();
}
}
@@ -8,21 +8,22 @@

/**
*
* @author Paul Bender Copyright (C) 2017
* @author Paul Bender Copyright (C) 2017
*/
public class VSDConfigPanelTest {

@Test
public void testCTor() {
VSDConfigPanel t = new VSDConfigPanel();
Assert.assertNotNull("exists",t);
Assert.assertNotNull("exists", t);
}

// The minimal setup for log4J
@Before
public void setUp() {
JUnitUtil.setUp();
jmri.util.JUnitUtil.resetProfileManager();
JUnitUtil.resetProfileManager();
JUnitUtil.initRosterConfigManager();
}

@After
@@ -32,5 +33,4 @@ public void tearDown() {
}

// private final static Logger log = LoggerFactory.getLogger(VSDConfigPanelTest.class);

}

0 comments on commit 2b3714e

Please sign in to comment.
You can’t perform that action at this time.