Problem in executing JFCunit test case
Hi all,
I have problem in executing a simple test case that checks for input blank fields entered.
Below is the code for the test class that i am trying to run, but i am unable to execute it. Please can anyone try to resolve this.
package unittest.com.erp;
import junit.extensions.TestSetup;
import junit.extensions.jfcunit.*;
import junit.extensions.jfcunit.finder.*;
import junit.extensions.jfcunit.eventdata.*;
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
import com.erp.client.swing.ClientLoginDialog;
import com.erp.client.swing.workspace.ClientWorkspaceFrame;
import com.erp.client.swing.workspace.data.LoginResults;
import javax.swing.*;
public class LoginScreenTest
extends JFCTestCase {
private ClientLoginDialog loginScreen = null;
private JButton login = null;
private JButton cancel = null;
private JTextField username = null;
private JTextField password = null;
private JFCTestHelper helper = null;
LoginResults loginSuccess = null;
ClientWorkspaceFrame workspaceFrame = null;
public LoginScreenTest() {
public LoginScreenTest(String name) {
super(name);
public static Test suite() {
return new StartApp(new TestSuite(LoginScreenTest.class));
private static class StartApp
extends TestSetup {
* Construct the test decorator, which starts the application *
* @param test
* Test case.
public StartApp(final Test test) {
super(test);
* Start the LoginScreenTestapplication.
public void setUp() {
new Thread(new Runnable() {
public void run() {
try {
new LoginScreenTest().setUp();
} catch (Exception e) {
}).start();
try {
Thread.currentThread().sleep(10000);
} catch (InterruptedException ex) {
* Tear down the LoginScreenTest application.
public void tearDown() {
protected void setUp()
throws Exception {
super.setUp(); // Choose the text Helper
setHelper(new JFCTestHelper()); // Uses the AWT Event Queue.
// setHelper( new RobotTestHelper( ) ); // Uses the OS Event Queue.
ClientWorkspaceFrame workspaceFrame = ClientWorkspaceFrame.getHandle();
// loginScreen = new ClientLoginDialog( "LoginScreenTest: " + getName());
loginSuccess = ClientLoginDialog.login();
loginScreen = ClientLoginDialog.login(new JFrame(), true);
if (loginSuccess != null && loginSuccess.isSuccess()) {
workspaceFrame.initFrame();
workspaceFrame.loggedInUser = loginSuccess.getName();
workspaceFrame.loggedInFullUserName = loginSuccess.getFullLoginUserName();
workspaceFrame.loggedInUserPassword = loginSuccess.getPassword();
workspaceFrame.setVisible(true);
workspaceFrame.validate();
flushAWT();
protected void tearDown()
throws Exception {
login = null;
cancel = null;
username = null;
password = null;
loginScreen = null;
flushAWT();
// getHelper.cleanUp( this );
super.tearDown();
public void testInitialState() {
NamedComponentFinder finder = new NamedComponentFinder(JButton.class, "Cancel");
finder.setName("Cancel");
JButton exitButton = (JButton) finder.find(loginScreen, 0);
assertNotNull("Could not find the Exit button", exitButton);
NamedComponentFinder finder1 = new NamedComponentFinder(JButton.class, "Login");
finder1.setName("Login");
JButton enterButton = (JButton) finder1.find(loginScreen, 0);
assertNotNull("Could not find the Enter button", enterButton);
getHelper().enterClickAndLeave(new MouseEventData(this, enterButton));
assertEquals("", workspaceFrame.loggedInUser);
assertEquals("", workspaceFrame.loggedInUserPassword);
public static void main(final String[] args) {
TestRunner.run(LoginScreenTest.suite());
Thanks & Regards,
VishalMessage was edited by:
vishal_vj
Message was edited by:
vishal_vj
Message was edited by:
vishal_vj
Message was edited by:
vishal_vj
hi All,
can any one guide me how to run the test casese in JFCunit ? as when i tried to run thru command prompt its not recognising the main class at all.
Now i m trying with eclipse problem here is that it is showing error to this line of code
DialogFinder dFinder = new DialogFinder(loginScreen);
error is constructor is undefined?
So looking for some solution.
with regards
kin
Similar Messages
-
Executing Junit test case in EM console
Hi ,
When i execute Junit test case in EM console, and against the tab test runs my assertion details gets failed and data in both column, expected value and actual value remains the same but in the expected value column the name space gets automitically populated. Am not able to include the namespace in Junit test case as it gets removed at the run time .
Kindly suggest.Were you able to solve this issue ?
-
How can I execute the test case written excel sheet
Hello
I have written the test cases in excel sheet. Please tell any one how to execute test case from labview.please send some sample viI'm sorry, but you've provided zero information on what you have. All you've said is that you have an Excel "sheet" with test cases, and that it's written in VBA. What does that even mean? What's written in VBA? Are you trying to call the VBA code? Are you trying to rewrite the VBA code in LabVIEW? Unless you provide a better explanation of what you have and what you are trying to do, we can just keep playing a guessing game.
-
Where should i found the executed automation test cases result in TestResult folder?
we are using VS2013, i have automated some coded ui test cases and executed from test explorer. once completed i am able to view the test result in the Test explorer window. But I am unable to view in the 'TestResult' folder under project location. (In The
Test result folder created IN & Out sub folder ) I think it should be create .trx file under TestResult folder. is there any configuration required.
Please guide me.
Thanks in Advance.Hi Divakar,
Thank you for posting in MSDN forum.
As far as I know that when we automated coded ui test cases from VS IDE, it is default that there have no the .trx file be created in the TestResult folder. However, there have a replace workaround that we can automate coded ui test cases using MSTest.exe
in command line. And then we can get the .trx file be created in the TestResult folder.
So you can execute the /resultsfile command to get the .trx file using mstest.exe in command line.
Reference:
https://msdn.microsoft.com/en-us/library/ms182489.aspx?f=255&MSPPError=-2147217396
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Hi everyone,
I'm following the test cases specified in the AirPlay Product Compliance Test R6 Document for AirPlay. I'm unable to execute the below test cases when I'm testing for airPlay certification. There is no option in the latest Airport Utility on Macbook for executing these test cases,
Is it mandatory to execute and pass these test cases? How do I do it?
3.2.1.3 Link Layer Connection 10 Mbps/Full Duplex
3.2.1.5 Link Layer Connection 100 Mbps/Full Duplex
Thanks in advance for your help.
SripadDiane,
Thank you very much for the response.
I will email you the screen shots since I can not attach them to this post.
You will see in the screen shots that I don't see either a green or red light after I have clicked on the record topic icon from UPK Developer. Even after I put focus on the title bar of the app I am recording and press the printscreen button, there is no green or red light.
But now, when I do press the printscreen button, UPK does actual record something. That is further than I have gotten before.
Before I posted the forum, I was not able to record anything after several attempts and also several re-installations. But I was told that if I don't see the green or red light, I won't be able to record anything.
I am now wondering if the use of Hypersnap 6 could be impacting UPK? I use Hypersnap a lot and when I pressed the printscreen button, Hypersnap also takes a screenshot.
My question now is whether the lack of green and red lights will impact my use of UPK?
Thanks
Chris
Edited by: user455985 on Dec 22, 2010 2:04 PM -
Setting bind variables for VO in JUnit test case
Hi,
I am using Jdeveloper 11.1.2.2
I have a problem while writing the test case for VO in JUnit.
For the Remove method in the Test case , I have passed variables into the VO by using a setWhereClause() .
Like this :
view.setWhereClause(null);
String whereClause = "location_id = '" + newUpdatedLocationId + "' AND organization_id = '" +newOrganizationId + "'" ;
view.setWhereClause(whereClause);
view.executeQuery();
while (view.hasNext()) {
view.next();
view.removeCurrentRow();
fixture1.getApplicationModule().getTransaction().commit();But it is showing a an error like the bind variables are not set.
So how will I access Bind variables programmatically and set the values ?
Thanks
Nigel.setNamedWhereClauseParam() is used for setting bind variables
-
How to dispatch the result from test cases to the function that loads
Hi ,
I am currently working on writing a test case and i ant to execute the test case and the result of the test cases needs to be returned to function that loads the swf file using loader.
Below is the structure
1) Project A
Has a action script file that has a loader which inturn loads the swf file.
public function testRunner():void {
loader = new Loader();
loaderDispatcher = loader.contentLoaderInfo;
sharedEvents = loaderDispatcher.sharedEvents;
parentURL = loaderDispatcher.loaderURL;
parentDomain = URLUtil.getServerNameWithPort(parentURL);
parentScheme = URLUtil.getProtocol(parentURL);
load("http://localhost:8000/abc.swf");
var callback:Function = addAsync(onMessage, 30000, {}, handleTimeout);
sharedEvents.addEventListener("message", callback);
/*Listener added to receive message event*/
sharedEvents.addEventListener(MessageEvent.MESSAGE, onMessageEvent);
private function load(location:String):void {
// create SWF loader
loaderDispatcher.addEventListener(Event.OPEN, onOpenEvent);
loaderDispatcher.addEventListener(Event.INIT, onINIT);
loaderDispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, onStatus);
loaderDispatcher.addEventListener(Event.COMPLETE, onComplete);
loaderDispatcher.addEventListener(IOErrorEvent.IO_ERROR, onError);
loaderDispatcher.addEventListener(Event.UNLOAD, onUnload);
loaderDispatcher.addEventListener(Event.CLOSE, onClose);
var request:URLRequest = new URLRequest(location);
//request.idleTimeout = 8000;
try{
loader.load(request);
_subMovie.addChild(loader);
catch (error:Error)
trace("Unable to load URL: " + error);
// listen for DISPATCH events
sharedEvents = loader.contentLoaderInfo.sharedEvents;
sharedEvents.addEventListener(DISPATCH_EVENT_TYPE, handleDispatch);
2) Project B
Project B has the test cases written and teh swf file for this project is abc.swf.
test.mxml
public function go():void {
var core:FlexUnitCore = new FlexUnitCore();
core.addListener(new TestCaseListener());
core.run(ABCTest);
var messageEvent:MessageEvent = new MessageEvent("message","action test","action testing");
//loaderInfo.sharedEvents.dispatchEvent(messageEvent);
When I load abc.swf file this inturn call the mxml file which runs the testcases by using the FlexUnitCore .
What I am looking for is dispatching the result that is available in TestcaseListener to the call of loader ie; in Project A
public class TestCaseListener extends RunListener {
public override function testRunFinished(result:Result):void {
trace("testRunFinished invoked 1 ::");
trace("failureCount::"+result.failureCount);
trace("failures::"+result.failures);
trace("successful::"+result.successful);
Is there any way in which i can dispatch the result from testcaselistener to the call where this swf file is loaded .Hello Sue,
I just tried to export to excel with the esdev extension and got java.lang.NumberFormatException. I found the workaround at Re: Windows Multi-language env, - how do I set English for application lang?
open the file sqldeveloper\jdev\bin\sqldeveloper.conf and add the following two lines:
AddVMOption -Duser.language=en
AddVMOption -Duser.country=USyet now my date formats in excel are 'american-style' instead of german. For example 01-DEC-01 so excel does not recognize it as date and therefore I can not simply change the format.
When export to excel will be native to 1.1 perhaps someone can have a look at this 'feature'
Regards
Marcus -
JUnit - Strange Test Case running problem
Hi Everyone,
I am very new to J Unit testing. Here's my problem. I have a project set up in Net Beans. Inside the project, there is a folder named "tests". This folder contains the following class:
public class Bob
public static void main(String[] args)
System.out.println("Hello");
}There are other classes inside of this folder that extend TestCase and TestSuite. They are functionally working according to J Unit testing (they prompt a JUnit Test Results panel in Net Beans with Pass or Fail).
The problem that I am having upon running/executing the class "Bob", NetBeans treats it as a JUnit test case and brings up a Pass/Fail panel. I do not want this to happen. I just want this class to print "Hello" as if it was not a Test. Do you guys have any idea what the problem is? My "Bob" class has nothing imported.
Also, I have another question. Is there a way that I can take INPUT from a user when running a Test Case (such as using the Scanner class)? My test cases seem to skip over the Scanner.nextLine() code for some reason.
Thanks in advance.Hi BigDaddy,
Thanks for the suggestion, however I am unsure of what you mean by injecting the scanner. Here is an example of what I would like to do:
public class BenchmarkTestSuite extends TestSuite
public static void main(String[] args)
try
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number of iterations for read: ");
readIterations = scan.nextInt();
.... etc
catch(Exception ex)
ex.printStackTrace();
.... etc
}Here, the prompted question for the user gets ignored for some odd reason. I would like for the tests to not start until the question has been answered by the user. NetBeans is strange. I commented all of the test methods to see if the question gets printed to the console, and it does not.
Thanks. -
Test case: unusual locking problem or expected behaviour?
I have tried the following test case on both 9.0.1 and 10.2.0. The problem I am seeing here is that a table receives an exclusive lock that doesn't get trapped by a FOR UPDATE NOWAIT condition.
Test case setup
create table x (
f1 number not null,
f2 varchar2(100) );
create table y (
f1 number not null,
f2 number not null,
f3 number,
f4 varchar2(100) );
alter table x add constraint pk_x
primary key (f1);
alter table y add constraint pk_y
primary key (f1);
/*** This is a self-referential integrity check ****/
alter table y add constraint fk_y
foreign key (f3)
references y ( f1 );
create or replace trigger trig_y
before insert on y
for each row
begin
update x
set f2 = 'trig test ' || to_char(sysdate,'ddmmyyyy hhmiss')
where f1 = :new.f2;
end;
insert into x values (1,'test 1');
insert into x values (2,'test 2');
insert into x values (3,'test 3');
insert into y values (2,2,2,'y test 2');
insert into y values (3,3,3,'y test 3');
commit;
Test case actions
This requires 3 independent sessions to be started.
* SESSION 1 *
select * from x
where f1 = 1
for update nowait;
* SESSION 2 *
insert into y values (1,1,1,'test');
-- This session waits because of the trigger that is attempting to update the
-- same row that is locked in session 1.
* SESSION 3 *
select *
from y
where f1 = 2
for update of f1 nowait;
-- The row lock succeeds.
-- Now update the primary key column in Y.
update y
set f1 = 2
where f1 = 2;
-- This update statement waits because of a lock. Why is this as the row
-- has been successfully locked by the FOR UPDATE?
-- Remove the foreign key constraint from table Y and try again. This time
-- the update will not wait but will complete successfully.
Is this expected behaviour, or a bug in self-referential integrity checks, or in
all foreign keys? The reason this came about in our application is because FORMS attempts to update every column on a block regardless of whether all values in the block have changed. This includes the primary key columns.
We have worked around this issue for now by setting the 'update changed columns only' property on blocks in the forms.No. All you are doing there is stating your intention of later updating the selected locked rows.
You may not even update any rows, if the program logic decides that way. Your actual update is the only case where the validation of foreign key will be applied. It cannot be done at the time of doing FOR UPDATE select, since the database does not know what new value is going to be when you do update so it is not possible to check.
Also, note that yoru statement did NOT fail. It was just rying to validate your foreign key, and in that process wants to make sure no one else makes the changes. The statement was waiting for resource to be free, it DID NOT FAIL (no error was raised). -
How to execute Coded UI automated test case remotely without installing Visual studio?
We are using visual studio 2013 premium. my object is to run the Coded ui automated test case remotely without installing visual studio. can you guide me how to approach it successfully ?
Thanks in Advance..Hi Divakar,
According to your description,
as far as I know that if we want to run the automation test remotely without vs using mstest, we will need to install and configure the test controller and the test agent machine.
Please refer to the following steps configure the test controller on locally machine and install a test agent on the remotely machine.
Note: If you an
automation test on locally machine, we must make sure the test agent be installed on remotely
machine.
Step1: you can try to
configure test controller and agent, for more information:
http://msdn.microsoft.com/en-us/library/hh546459.aspx
Step2: you will need to
assign roles to a Test Controller and Test Agent for Automated Testing in Visual Studio, please see:
http://msdn.microsoft.com/en-us/library/ff469838.aspx
Note: you will need to add a testsetting file before you assign roles to a Test Controller and Test Agent for Automated
Testing in Visual Studio.
Reference:
http://msdn.microsoft.com/en-us/library/ee256991.aspx
Step3: After you configure and install the test controller and test agent successfully, we can
executed coded UI test remotely using mstest.exe on test agent machine, we would call the testsetting file in command line.
Reference:
How
to use MSTest.exe command-line options
In addition, I find an article about
Running tests in mstest without installing the VS IDE, please see:
http://blogs.msdn.com/b/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Problem at the time of Implementing Text Matching Test Case in OFT
hi,
I had add Text Matching Test Case on login of the application for the username and password. and If the Test Case fail on that screen,then it should not allow to go further in the application.
As currently at the time of Playback, it is allowing to go further and in the Result Report it display the case failed.Actually my ques is that suppose at the time of recording i enter the username as abcd and password as 123.
When the recording is done . I Insert a Text Matching test case for both the username and password where i put the condition for the username that select text should be present as "def" . And the Test Case failed .
So i want to know that if the test case failed on Login. Whether it should be move forward at the time of playback? -
Hi guys,
we are using solution manager for testing. We have created the test case with test case type "Test Document" in SOLAR02 transaction. Here we are trying to attach our test script sothat it can be included in the test note generated by blue-print.
But when we create a test case, the system is automatically taking the attribute as "Blue-print relavant" and because of this we are not able to create a test note. WE are getting a message that test case is defined as blue-print relavant.
Where can we change the attribute of the test case ?
Can anybody helpme outHi Sai Vineeth,
1) Please get into SOLAR_PROJECT_ADMIN transaction
2) Choose your project ID
3) Toggle to Change mode
4) Get to Project Standards Tab
5) Go to Documentation Types sub Tab
6) Click on 'Project Template' button at the right bottom side
7) In the window that opens up, go through the document types that you want to take off Blueprint relevance, use the cursor to move it towards the right - you'll find a column meant for Blueprint relevance
8) Take the checkbox away, press the button Check and then Save.
9) Then press on 'Cancel (red X) icon.
This should make the Blueprint relevance disappear for the given Document Type.
Cheers,
Srini -
Problem in writing test cases in BI
Hello Sir,.
How to write a test cases in BI? and we are doing function upgrade as we are migratiing 3.x to 7.x BI.
we have a data flow as show below at the moment after the migration has done.
Data source->Transformation->DSO->Transformation->Info Cube.each target has individual DTP`s.
Finally data is lieing all over the data targets.I have no routine between Data source and DSO , but we have a start routine between DSO and Info Cube.
So i am trying to write a test cases because we want to know how the code was working in 3.x and aafter migrating the to 7.x bi how the code is working and then loaded data to targets.How do i write functional test cases? and how to proceed to write test cases here in this scenario.please reply me asap.
Thanks much!No,
I try to explain better:
In my real application (not this simple example) I compose an image by the union of many little gifs. Then I have to save the result in a unique image. It's for this that I've overridden paintComponent(), so , after having painted all gifs, I save composite image to a png one.
This function is activated from a main application, and I don't want to show too much to user, so I try to make this by using a popup frame that disappear quickly.
I hope to having been as clear as possible.
I hope to have chosen the best solution too
Bye and thanks
Edited by: giuseppe_italiano on Nov 21, 2007 3:35 AM -
Hi,
I played a little on my test machine and get interesting results so if someone could explain me what happens here I would be grateful.
It is obvious that some data corruption happened but still interesting situation.
OS: Linux 32bit
Oracle: 10.2.0.2.0
TEST CASE:
1. Created tablespace and one table in that tablespace:
SQL> create tablespace test_tbs datafile '/oradata/tbs01.dbf' size 75M autoextend on next 10M maxsize 512M;
Tablespace created.
SQL> create table objtab tablespace test_tbs as select * from dba_objects where 1=2;
Table created.
2. Made two more copies of tbs01.dbf datafile:
SQL> !cp tbs01.dbf tbs02.dbf
SQL> !cp tbs01.dbf tbs03.dbf
3. Insert some rows into table objtab:
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> /
50417 rows created.
SQL> /
50417 rows created.
SQL> commit;
Commit complete.
SQL> select count(*) from objtab;
COUNT(*)
151251
4. Deleted tbs01.dbf:
SQL> !rm tbs01.dbf
5. Insert still works:
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> commit;
Commit complete.
6. Renamed tbs02.dbf to tbs01.dbf:
SQL> !mv tbs02.dbf tbs01.dbf
7. Inserted new rows:
SQL> select count(*) from objtab;
COUNT(*)
302502
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> commit;
Commit complete.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> commit;
Commit complete.
8. Check size of datafile:
SQL> !du -hs tbs01.dbf
*96M tbs01.dbf*
SQL> select count(*) from objtab;
COUNT(*)
756255
9. Deleted datafile tbs01.dbf and renamed tbs03.dbf to tbs01.dbf:
SQL> !rm tbs01.dbf
SQL> !mv tbs03.dbf tbs01.dbf
10. Insert more rows and executed "alter system checkpoint":
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> insert into objtab select * from dba_objects;
50417 rows created.
SQL> commit;
Commit complete.
SQL> alter system checkpoint;
System altered.
SQL> select count(*) from objtab;
COUNT(*)
907506
11. When I check the size of tbs01.dbf it is smaller then before despite of more rows I inserted. How come? Where are all this rows stored?
SQL> !du -hs tbs01.dbf
*86M tbs01.dbf*
12. Now try to offline tablespace and then I get errors in alertlog:
SQL> alter tablespace test_tbs offline normal;
alter tablespace test_tbs offline normal
ERROR at line 1:
ORA-00603: ORACLE server session terminated by fatal error
ALERT LOG
Errors in file /oracle/admin/um/udump/um_ora_501.trc:
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01122: database file 6 failed verification check
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01208: data file is an old version - not accessing current version
Fri May 29 09:01:31 2009
ORA-600 signalled during: alter tablespace test_tbs offline normal...
Fri May 29 09:01:31 2009
Errors in file /oracle/admin/um/udump/um_ora_501.trc:
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01122: database file 6 failed verification check
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01208: data file is an old version - not accessing current version
Fri May 29 09:01:37 2009
Errors in file /oracle/admin/um/udump/um_ora_501.trc:
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01122: database file 6 failed verification check
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01208: data file is an old version - not accessing current version
Fri May 29 09:01:43 2009
Errors in file /oracle/admin/um/udump/um_ora_501.trc:
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-00600: internal error code, arguments: [krhpfh_03-1208], [fno =], [6], [fecpc =], [4], [fhcpc =], [3], []
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01122: database file 6 failed verification check
ORA-01110: data file 6: '/oradata/tbs01.dbf'
ORA-01208: data file is an old version - not accessing current version
13. One more check:
SQL> select tablespace_name, status from dba_tablespaces;
TABLESPACE_NAME STATUS
SYSTEM ONLINE
SYSAUX ONLINE
USERS ONLINE
UNDOTBS2 ONLINE
TMP ONLINE
TEST_TBS ONLINE
7 rows selected.
SQL> select count(*) from objtab;
COUNT(*)
907506
14. Restart database:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 1224736768 bytes
Fixed Size 1267188 bytes
Variable Size 1006635532 bytes
Database Buffers 201326592 bytes
Redo Buffers 15507456 bytes
Database mounted.
Database opened.
15. Try to count(*) from table but it says that object no longer exists:
SQL> select count(*) from objtab;
select count(*) from objtab
ERROR at line 1:
ORA-08103: object no longer exists
SQL> select tablespace_name, status from dba_tablespaces;
TABLESPACE_NAME STATUS
SYSTEM ONLINE
SYSAUX ONLINE
USERS ONLINE
UNDOTBS2 ONLINE
TMP ONLINE
TEST_TBS ONLINE
7 rows selected.
16. If object does not exist, how come I get this results (probably leftovers in data dictionary):
SQL> desc objtab;
Name Null? Type
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
SQL> create table objtab tablespace test_tbs as select * from dba_objects;
create table objtab tablespace test_tbs as select * from dba_objects
ERROR at line 1:
ORA-00955: name is already used by an existing object
17. To drop object (can't drop):
SQL> drop table objtab;
drop table objtab
ERROR at line 1:
ORA-08103: object no longer exists
18. Clean up:
SQL> drop tablespace test_tbs including contents and datafiles;
Tablespace dropped.
Best Regards,
MarkoHi Uwe,
as I said before my intention was to understand behavior of Oracle and Linux in scenario like this.
I thought about what will happen if some Linux admin by mistake moves live datafile to another location and after 5-10 mins, when he realizes his mistake, he moves the datafile to old (original) location.
Will Oracle notice some errors in alert log? (In my test case I didn't receive any message in alert log)
How will I know (as a DBA) what was done with this datafile if Linux admin does not say anything to me?
Is any damage made to datbase ? (Probably)
etc...
When I am on my test machine I like to do all kind of stuff and try anything that comes on my mind. It isn't important to me if this scenario has any connection to real world problems. I enjoy doing this so I like to spend some of my time on this test cases.
Anyway thanks for your comment.
Regards,
Marko
Edited by: msutic on May 29, 2009 1:03 PM -
Problem in executing Stored Procedure from Trigger
Hi,
Case1.
I am executing a stored procedure form a trigger. The stored procedure is not executing fully.
Case 2.
But when when I execute Stored Procedure alone it is executing.
CREATE OR REPLACE TRIGGER mhubadmin.call_proc_ratesheet_new
after INSERT OR delete ON mhubadmin.pvt_br_ratesheet
FOR EACH ROW
declare
var_orgid number;
begin
if inserting then
select org_child_id into var_orgid from business_relationship where br_id=:new.br_id;
mhubadmin.proc_ratesheet_new(var_orgid);
else
select org_child_id into var_orgid from business_relationship where br_id=:old.br_id;
mhubadmin.proc_ratesheet_new(var_orgid);
end if;
end;
CREATE OR REPLACE PROCEDURE proc_ratesheet_new(var_orgid in number)
IS
cursor c3 is select distinct(purs.user_id) from hubuser hu
inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
where hu.ORG_ID=var_orgid;
cursor c1(varUser_id number) is select purs.user_id,purs.ratesheet_id from hubuser hu
inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
where hu.ORG_ID=var_orgid and purs.USER_ID=varUser_id;
cursor c2(varUser_id number) is select hu.user_id,pbr.ratesheet_id from HUBUSER hu
inner join BUSINESS_RELATIONSHIP br on hu.ORG_ID=br.ORG_CHILD_ID
inner join PVT_BR_RATESHEET pbr on br.BR_ID=pbr.BR_ID
where hu.user_id in(select distinct(purs.USER_ID) from hubuser hu
inner join PVT_USER_RATESHEET purs
on hu.USER_ID=purs.USER_ID
where hu.ORG_ID=var_orgid) and hu.user_id=varUser_id;
foundFlag boolean;
incrFound integer;
insertFound integer;
deleteFound integer;
str varchar2(4000);
BEGIN
incrFound:=0;
insertFound:=0;
for c3var in c3 loop
for c2var in c2(c3var.user_id) loop
insert into test values ('Step3:'||c2var.user_id);
foundFlag:=false;
for c1var in c1(c3var.user_id) loop
if c2var.ratesheet_id=c1var.ratesheet_id then
foundFlag:=true;
incrFound:=incrFound+1;
exit;
end if;
end loop;
if foundFlag=False then
--insert into pvt_user_ratesheet (username_ratesheet_id,user_id,ratesheet_id) values (SEQ_USER_RATESHEET.nextval,c3var.user_id,c2var.ratesheet_id);
dbms_output.put_line('Inserted for user :'||c3var.user_id||' is - ratesheet :'||c2var.ratesheet_id);
insertFound:=insertFound+1;
end if;
end loop;
end loop;
commit;
incrFound:=0;
deleteFound:=0;
for c3var in c3 loop
for c1var in c1(c3var.user_id) loop
foundFlag:=false;
for c2var in c2(c3var.user_id) loop
if c1var.ratesheet_id=c2var.ratesheet_id then
foundFlag:=true;
incrFound:=incrFound+1;
exit;
end if;
end loop;
if foundFlag=False then
--delete from pvt_user_ratesheet where user_id=c3var.user_id and ratesheet_id=c1var.ratesheet_id;
--dbms_output.put_line('Deleted for userid:'||c3var.user_id||' for ratesheet :'||c1var.ratesheet_id);
deleteFound:=deleteFound+1;
end if;
end loop;
end loop;
commit;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line (SQLCODE||' '|| SQLERRM);
END;
Regards,
MathewIn general, I would suggest that you only catch errors that you can handle reasonably. If you know that a SELECT INTO might return 0 rows for example, handle the NO_DATA_FOUND exception. Having a WHEN OTHERS, particularly without re-raising the exception, only serves to hide the source of the problem. I would much rather that my code fail quickly and explicitly than hope that I see an error message in the output and that other code doesn't start failing because the system wasn't left in an appropriate state.
As Mark suggests, you may choose to implement a comprehensive logging framework using autonomous transactions, in which case a WHEN OTHERS would be reasonable, but you would still want to propagate exceptions you cannot handle.
If you see a WHEN OTHERS clause and there is no RAISE, you probably have an error waiting to happen.
Justin
Maybe you are looking for
-
About the program of free Lion
I just bought a macbook pro with snow leopard. I learned about the program for free Lion. I purchased it from Italy, but i live in Greece and i have a greek account in apple. Can i take a redeem code via greek store? Or i have to take it from an ital
-
Cisco Layer 3, Voice, & VLAN
I have a vSphere 5.5 install and I'm in the process of a network upgrade in preparation for a VOIP implementation. The Switch hardware I'm using is a stack of Cisco 3850 Layer 3 switches and I've been going in circles on getting vlan traffic to work
-
Change Language on Reader Pocket Edition
I accidentally set up my Reader in the wrong language. How can I change the language to English?
-
I am trying to compile a simple hello world type command line program. When I type gcc hello.c -o hello i get: -bash: gcc: command not found I am running OS X ver. 10.7.3 I have Xcode 4.3.2 installed And yes, I'm completely new to Mac. Any and all ad
-
My TV Shows are manually added. They show up clean on the iTunes Library, as they should. After synching with the iPad all Shows are merged together to one show without any title. Please check the screenshots below. I already tried to select all medi