001: //$Header$
002: /*
003: * Licensed to the Apache Software Foundation (ASF) under one or more
004: * contributor license agreements. See the NOTICE file distributed with
005: * this work for additional information regarding copyright ownership.
006: * The ASF licenses this file to You under the Apache License, Version 2.0
007: * (the "License"); you may not use this file except in compliance with
008: * the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: *
018: */
019: package org.apache.jmeter.report.writers;
020:
021: /**
022: * @author Peter Lin
023: *
024: * This is a basic implementation of PageSummary interface.
025: */
026: public class DefaultPageSummary implements PageSummary {
027:
028: private long START = 0;
029: private long END = 0;
030: private String Title;
031: private String FileName;
032: private boolean Success;
033:
034: /**
035: *
036: */
037: public DefaultPageSummary() {
038: super ();
039: }
040:
041: /**
042: * Returns the elapsed time in milliseconds
043: */
044: public long getElapsedTime() {
045: return END - START;
046: }
047:
048: public long getEndTimeStamp() {
049: return END;
050: }
051:
052: /* (non-Javadoc)
053: * @see org.apache.jmeter.report.writers.PageSummary#getFileName()
054: */
055: public String getFileName() {
056: return FileName;
057: }
058:
059: /* (non-Javadoc)
060: * @see org.apache.jmeter.report.writers.PageSummary#getPageTitle()
061: */
062: public String getPageTitle() {
063: return Title;
064: }
065:
066: public long getStartTimeStamp() {
067: return START;
068: }
069:
070: /* (non-Javadoc)
071: * @see org.apache.jmeter.report.writers.PageSummary#isSuccessful()
072: */
073: public boolean isSuccessful() {
074: return Success;
075: }
076:
077: /* (non-Javadoc)
078: * @see org.apache.jmeter.report.writers.PageSummary#pageStarted()
079: */
080: public void pageStarted() {
081: START = System.currentTimeMillis();
082: }
083:
084: /* (non-Javadoc)
085: * @see org.apache.jmeter.report.writers.PageSummary#pageEnded()
086: */
087: public void pageEnded() {
088: END = System.currentTimeMillis();
089: }
090:
091: /* (non-Javadoc)
092: * @see org.apache.jmeter.report.writers.PageSummary#setFileName(java.lang.String)
093: */
094: public void setFileName(String file) {
095: this .FileName = file;
096: }
097:
098: /* (non-Javadoc)
099: * @see org.apache.jmeter.report.writers.PageSummary#setPageTitle(java.lang.String)
100: */
101: public void setPageTitle(String title) {
102: this .Title = title;
103: }
104:
105: /* (non-Javadoc)
106: * @see org.apache.jmeter.report.writers.PageSummary#setSuccessful(boolean)
107: */
108: public void setSuccessful(boolean success) {
109: this.Success = success;
110: }
111:
112: }
|