Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338823 - test_getPrinterList() fails when no default printer is selected
Summary: test_getPrinterList() fails when no default printer is selected
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks: 295393
  Show dependency tree
 
Reported: 2011-03-03 10:42 EST by Kim Moir CLA
Modified: 2019-10-05 17:16 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Moir CLA 2011-03-03 10:42:07 EST
Not sure how to configure the Mac Hudson slave at the foundation so this test doesn't fail. Help please :-)

https://hudson.eclipse.org/hudson/view/Eclipse%20and%20Equinox/job/eclipse-JUnit-mac/57/testReport/org.eclipse.swt.tests.junit/Test_org_eclipse_swt_printing_Printer/test_getPrinterList/

Failed

org.eclipse.swt.tests.junit.Test_org_eclipse_swt_printing_Printer.test_getPrinterList (from Test_org_eclipse_swt_printing_Printer)
Failing for the past 1 build (Since Unstable#57 )
Took 0.59 sec.
edit description
Error Message

printer list contains items even though there are no printers

Stacktrace

junit.framework.AssertionFailedError: printer list contains items even though there are no printers
	at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_printing_Printer.test_getPrinterList(Test_org_eclipse_swt_printing_Printer.java:176)
	at org.eclipse.swt.tests.junit.Test_org_eclipse_swt_printing_Printer.runTest(Test_org_eclipse_swt_printing_Printer.java:247)
	at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:416)
	at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:249)
	at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
	at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
	at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
	at org.eclipse.core.launcher.Main.main(Main.java:34)
Comment 1 Scott Kovatch CLA 2011-03-03 11:47:12 EST
I think this may be a genuine failure. I recall running this on 10.5 and getting the same failure on a machine that never had any printers set up for it.
Comment 2 Markus Keller CLA 2016-04-25 14:34:53 EDT
I have an Ubuntu 14.04 machine that has no configured default printer.

Printer.getDefaultPrinterData() returns null, but Printer.getPrinterList() returns:

[PrinterData {driver = GtkPrintBackendFile, name = Print to File},
 PrinterData {driver = GtkPrintBackendCups, name = PostScript}]

Test_org_eclipse_swt_printing_Printer.test_getPrinterList() contains a hack for GTK that would still accept a single printer ("GtkPrintBackendFile"), but it fails in my case with two non-default printers.

The API doesn't preclude this setup, so the test should not fail. And at least some of the other tests that use getDefaultPrinterData() and give up early should also check getPrinterList() for a printer.
Comment 3 Eclipse Genie CLA 2019-10-05 17:16:23 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.