This commit is contained in:
Mali Bayhan 2021-10-26 21:52:45 -07:00
parent 96c28dd7b1
commit 84a95837ee
68 changed files with 354 additions and 2725 deletions

100
README.md
View File

@ -1 +1,99 @@
# sonarqubejava
# Multi-module Apache Maven example
This project imports JaCoCo's aggregate XML report to be able to report coverage across modules as well as unit test coverage inside the module.
For a basic example see [basic maven project](../maven-basic/README.md).
## Usage
* Build the project, execute all the tests and analyze the project with SonarQube Scanner for Maven:
```shell
mvn clean verify sonar:sonar
```
## Description
This project consists of 3 modules.
* [`module1`](module1/pom.xml) and [`module2`](module2/pom.xml) contain "business logic" and related unit tests.
* [`tests`](tests/pom.xml) module contains integration tests which test functionality using both modules.
`tests` module is also the one which creates the aggregate coverage report imported into SonarQube.
To generate the report we configure the JaCoCo plugin to attach its agent to the JVM which is executing the tests in the top level [pom](pom.xml).
This configuration is done in the `<pluginManagment>` section, so it will be applied on every submodule.
It is also configured inside the `coverage` profile, so this can be activated as needed (e.g. only in CI pipeline).
```xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
```
Once we have configured JaCoCo to collect coverage data, we need to generate the XML coverage report to be imported into SonarQube.
We will use [report-aggregate](https://www.jacoco.org/jacoco/trunk/doc/report-aggregate-mojo.html) goal which collects data from all modules dependent on the `tests` module.
To achieve this we configure the JaCoCo plugin by configuring execution of `report-aggregate` goal in `verify` phase.
See [pom.xml](tests/pom.xml)
```xml
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
```
This will create a report in `tests/target/site/jacoco-aggregate/jacoco.xml`. To import this report we will set
`sonar.coverage.jacoco.xmlReportPaths` property in every module on which this coverage should be imported
```xml
<properties>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
</properties>
```
We use `${aggregate.report.dir}` which is defined in the top level [`pom.xml`](pom.xml) to avoid duplicating the location of the report in every module.
Alternately we can set this property on the command line with the `-D` switch:
```shell
mvn -Dsonar.coverage.jacoco.xmlReportPaths=C:\projects\sonar-scanning-examples\sonarscanner-maven-aggregate\tests\target\site\jacoco-aggregate\jacoco.xml clean verify sonar:sonar
```
We have to use an absolute path, because the report will be imported for each module separately and the path is resolved relative to the module dir.
## Documentation
[SonarScanner for Maven](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/)

Binary file not shown.

View File

@ -1,3 +0,0 @@
Manifest-Version: 1.0
Class-Path:

Binary file not shown.

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>com.javatpoint.MyListener</listener-class>
</listener>
</web-app>

View File

@ -1,135 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Contact Us</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head><body>
<div id="main_container">
<div class="main_content">
<div id="header">
</div>
<div class="top_center_box"></div>
<div class="center_box">
<div id="menu_tab">
<ul class="menu">
<li><a href="home.jsp" class="nav">Home</a></li>
<li class="divider"></li>
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
<li class="divider"></li>
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
<li class="divider"></li>
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
<li class="divider"></li>
<li><a href="contact.html" class="nav">Contact</a></li>
<li class="divider"></li>
<li><a href="register.jsp" class="nav">Register</a></li>
</ul>
</div>
<div class="middle_box">
<div class="middle_box_text_content">
<div class="middle_box_title"></div>
</div>
</div>
<div class="left_content">
<div class="calendar_box">
<div class="calendar_box_content">
<h1>Contact Us</h1>
<img src="images/contact_icon.gif" alt="" title="">
<p class="contact_info">
<span class="orange">Adress:</span> H-109,Shakarpur<br>
<span class="orange">Telephone:</span> 0123456789<br>
<span class="orange">Email:</span> <a href="rishi.kumar91@facebook.com">info@company.com</a><br>
</p>
</div>
</div>
<div id="contact_form">
<h1>Ask Question</h1>
<form action="askq.jsp">
<div class="form_row">
<label>Name:</label><input name="name" class="contact_input" type="text">
</div>
<div class="form_row">
<label>Email:</label><input name="email" class="contact_input" type="text">
</div>
<div class="form_row">
<label>Phone:</label><input name="phone" class="contact_input" type="text">
</div>
<div class="form_row">
<label>Question:</label><textarea name="question" class="contact_textarea"></textarea>
</div>
<input type="submit" class="read_more" value="send"/>
</form>
</div>
</div><!--end of left content-->
<div class="right_content">
<h1>Our Clients</h1>
<div class="project_box">
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<a href="www.javatpoint.com">javatpoint.com</a>
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<a href="www.cstpoint.com">cstpoint.com</a>
</p>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,30 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<%
try {
String name= request.getParameter("name");
String email= request.getParameter("email");
String phone= request.getParameter("phone");
String question= request.getParameter("question");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("insert into quizq values(?,?,?,?)");
ps.setString(1,name);
ps.setString(2,email);
ps.setString(3,phone);
ps.setString(4,question);
int s= ps.executeUpdate();
}
catch(Exception e){e.printStackTrace();}
%>
<jsp:forward page="home.jsp"></jsp:forward>

View File

@ -1,135 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Contact Us</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head><body>
<div id="main_container">
<div class="main_content">
<div id="header">
</div>
<div class="top_center_box"></div>
<div class="center_box">
<div id="menu_tab">
<ul class="menu">
<li><a href="home.jsp" class="nav">Home</a></li>
<li class="divider"></li>
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
<li class="divider"></li>
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
<li class="divider"></li>
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
<li class="divider"></li>
<li><a href="contact.html" class="nav">Contact</a></li>
<li class="divider"></li>
<li><a href="register.jsp" class="nav">Register</a></li>
</ul>
</div>
<div class="middle_box">
<div class="middle_box_text_content">
<div class="middle_box_title"></div>
</div>
</div>
<div class="left_content">
<div class="calendar_box">
<div class="calendar_box_content">
<h1>Contact Us</h1>
<img src="images/contact_icon.gif" alt="" title="">
<p class="contact_info">
<span class="orange">Adress:</span> H-109,Shakarpur<br>
<span class="orange">Telephone:</span> 0123456789<br>
<span class="orange">Email:</span> <a href="rishi.kumar91@facebook.com">info@company.com</a><br>
</p>
</div>
</div>
<div id="contact_form">
<h1>Contact Us</h1>
<form action="quizcontact.jsp">
<div class="form_row">
<label>Name:</label><input name="name" class="contact_input" type="text">
</div>
<div class="form_row">
<label>Email:</label><input name="email" class="contact_input" type="text">
</div>
<div class="form_row">
<label>Phone:</label><input name="phone" class="contact_input" type="text">
</div>
<div class="form_row">
<label>Message:</label><textarea name="message" class="contact_textarea"></textarea>
</div>
<input type="submit" class="read_more" value="send"/>
</form>
</div>
</div><!--end of left content-->
<div class="right_content">
<h1>Our Clients</h1>
<div class="project_box">
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<a href="www.javatpoint.com">javatpoint.com</a>
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/clients_icon.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<a href="www.cstpoint.com">cstpoint.com</a>
</p>
</div>
</div><!--end of right content-->
<div id="footer">
<a href="http://www.webpagedesign.com.au">Art for the web</a>
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,15 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<% try {
String subject= request.getParameter("subject");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("insert into quizinfo(subject) values('"+subject+"') " );
int s= ps.executeUpdate();
}
catch(Exception e){e.printStackTrace();}
%>
<jsp:forward page="createquiz1.jsp"></jsp:forward>

View File

@ -1,157 +0,0 @@
<%@page import="java.awt.Dialog"%><jsp:include page="header.jsp"></jsp:include>
<%
String islogin=(String)session.getAttribute("islogin");
if(islogin==null){
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
%>
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' >");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("counter")!=null){
Integer i=(Integer)request.getAttribute("counter");
if(i==10){
request.setAttribute("finished","quiz successfully submitted");
%>
<jsp:forward page="home.jsp"></jsp:forward>
<%
}}
%>
<div class="left_content">
<div class="calendar_box2">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various sunject</B></marquee>
<form method="post" action="saveques.jsp" >
<table>
<tr><td>Question:</td><td><textarea rows="3" cols="" name="question" ></textarea></td></tr>
<tr><td>Option1:</td><td><input type="text" name="option1" /></td></tr>
<tr><td>Option2:</td><td><input type="text" name="option2" /></td></tr>
<tr><td>Option3:</td><td><input type="text" name="option3" /></td></tr>
<tr><td>Option4:</td><td><input type="text" name="option4" /></td></tr>
<tr><td>Answer:</td><td><input type="text" name="answer" /></td></tr>
<tr><td>Description:</td><td><input type="text" name="description" /></td></tr>
<tr><td></td><td><input type="submit" value="Next"></td></tr>
</table>
</form>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">23</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">23</div>
<div class="news_content">
<p><span></span>
we have latest projects uoloaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,17 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%
String n=request.getParameter("val");
if(n.length()>0){
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("select username from quizregister where username='"+n+"'");
ResultSet rs=ps.executeQuery();
while(rs.next()){
out.print("<font style='color:red'>Username already exist</font>");
}
con.close();
}catch(Exception e){e.printStackTrace();}
}//end of if
%>

View File

@ -1,28 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%
String n=request.getParameter("val");
if(n.length()>0){
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("select * from quizinfo where subject like '"+n+"%'");
//ps.setString(1,n);
out.print("<br>");
ResultSet rs=ps.executeQuery();
out.print("<table border='3' cellspacing=3 cellpadding=2 id='myTable'>");
out.print("<tr><td><B>Quizs</B></td><td><B>Subject</B></td></tr>");
while(rs.next()){
out.print("<tr><td><a href='#' name='"+rs.getString(2)+"' onclick='javascript:viewAll(this.name)'>Quiz"+rs.getString(2)+"</a></td>");
out.print("<td>"+rs.getString(1)+"</td>");
out.print("</tr>");
}
out.print("</table>");
con.close();
}catch(Exception e){e.printStackTrace();}
}//end of if
%>

View File

@ -1,14 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%
String n=request.getParameter("val");
session.setAttribute("quizname",n);
if(n.length()>0){
out.print("<font style='color:navy'><B>Quiz"+n+" containns 10 Question<br>Each question is of 1 point</B><br></font>");
out.print("<input type='submit' value='Start Quiz' />");
}
//end of if
%>

View File

@ -1,4 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<div id="footer">
</div>

View File

@ -1,60 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%--<%@page import="com.sun.org.apache.bcel.internal.generic.Select"--%>
<%! static int count=0; %>
<%! static int count1=0; %>
<%
String name=(String)session.getAttribute("quizname");
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
if(count==0){
PreparedStatement ps1= con.prepareStatement("select min(qid) from quizques where quizname='"+name+"'");
PreparedStatement ps2= con.prepareStatement("select max(qid) from quizques where quizname='"+name+"'");
ResultSet rs1= ps1.executeQuery();
ResultSet rs2=ps2.executeQuery();
if(rs2.next()){
count1=rs2.getInt(1);
session.setAttribute("max",count1);
}
if(rs1.next()){
count=rs1.getInt(1);
session.setAttribute("min",count);
}
}
if(count>0){
PreparedStatement ps=con.prepareStatement("select * from quizques where quizname='"+name+"' and qid='"+count+"' ");
ResultSet rs=ps.executeQuery();
while(rs.next()){
String question=rs.getString(1);
String option1= rs.getString(2);
String option2= rs.getString(3);
String option3= rs.getString(4);
String option4= rs.getString(5);
session.setAttribute("question",question);
session.setAttribute("option1",option1);
session.setAttribute("option2",option2);
session.setAttribute("option3",option3);
session.setAttribute("option4",option4);
}
}
System.out.print(count);
count++;
session.setAttribute("count",count);
if(count>(Integer)session.getAttribute("max")){
count=0;
session.setAttribute("ans",null);
}
con.close();
}catch(Exception e){e.printStackTrace();}
//end of if
%>
<jsp:forward page="start.jsp"></jsp:forward>

View File

@ -1,93 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%-- <%@page import="com.sun.org.apache.bcel.internal.generic.Select"%>--%>
<%! static int count1=0; %>
<%! static int total=0; %>
<%
if(session.getAttribute("count")!=null){
String name=(String)session.getAttribute("quizname");
String ans= (String)session.getAttribute("ans");
Integer count=(Integer)session.getAttribute("count");
try{
if(count1==0)
{
count1=count-1;
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+count1+"' ");
ResultSet rs=ps.executeQuery();
if(rs.next()){
String ans1=rs.getString(1);
System.out.println("ans1 on c10="+ans1);
System.out.println("ans on get1="+ans);
if(ans1.equals(ans)){
total=total+1;
System.out.println("total="+total);
}
}
con.close();
}
else{
count1=count-2;
System.out.print("count at get1:"+count);
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+count1+"' ");
ResultSet rs=ps.executeQuery();
if(rs.next()){
String ans1=rs.getString(1);
System.out.println("ans1="+ans1);
System.out.println("ans on get1="+ans);
if(ans1.equals(ans)){
total=total+1;
System.out.println("total="+total);
}
}
con.close();
}
if(count>(Integer)session.getAttribute("max"))
{
Integer max=(Integer)session.getAttribute("max");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("select answer from quizques where quizname='"+name+"' and qid='"+max+"' ");
ResultSet rs=ps.executeQuery();
if(rs.next()){
String ans1=rs.getString(1);
System.out.println("ans1 on c1="+ans1);
String ans2=(String) session.getAttribute("ans");
System.out.println("ans on get1="+ans2);
if(ans1.equals(ans2)){
total=total+1;
System.out.println("total="+total);
}
}
con.close();
request.setAttribute("total",total);
total=0;
%>
<jsp:forward page="result.jsp"></jsp:forward>
<%
}
}catch(Exception e){e.printStackTrace();}
}
%>
<jsp:forward page="get.jsp"></jsp:forward>

View File

@ -1,53 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Online Quiz</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head><body>
<div id="main_container">
<div class="main_content">
<div id="header">
</div>
<div class="top_center_box"></div>
<div class="center_box">
<div id="menu_tab">
<ul class="menu">
<li><a href="home.jsp" class="nav">Home</a></li>
<li class="divider"></li>
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
<li class="divider"></li>
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
<li class="divider"></li>
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
<li class="divider"></li>
<li><a href="contact.html" class="nav">Contact</a></li>
<li class="divider"></li>
<li class="divider"></li>
<li><a href="logout.jsp" class="nav">logout</a></li>
</ul>
</div>
<div class="middle_box">
<div class="middle_box_text_content">
<div class="middle_box_title"></div>
<p class="middle_text">
</p>
</div>
</div>

View File

@ -1,157 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<html>
<jsp:include page="header.jsp"></jsp:include>
<%
String islogin=(String)session.getAttribute("islogin");
if(islogin==null){
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
%>
<div class="left_content">
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' >");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("finished")!=null){
out.print("<font size='2' color='navy'>");
out.print("<B>");
out.print(request.getAttribute("finished"));
out.print("<B>");
out.print("</font>");
}
if(request.getAttribute("category")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("category"));
out.print("</font>");
}
%>
<div class="calendar_box">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
<p>
<font style="color: navy;">Now Teacher and Student can work together<br>
online.Tutors are most welcomed to my site <br>
they can create Quiz simply by clicking Make<br>
Quiz link.And Students can appear in quiz based on various
subject. </font>
</p>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">1</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">2</div>
<div class="news_content">
<p><span></span>
we have latest projects uploaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

View File

@ -1,183 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Login Form</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head><body>
<div id="main_container">
<div class="main_content">
<div id="header">
</div>
<div class="top_center_box"></div>
<div class="center_box">
<div id="menu_tab">
<ul class="menu">
<li><a href="home.jsp" class="nav">Home</a></li>
<li class="divider"></li>
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
<li class="divider"></li>
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
<li class="divider"></li>
<li><a href="contact.html" class="nav">Contact</a></li>
<li class="divider"></li>
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
<li class="divider"></li>
<li><a href="register.jsp" class="nav">Register</a></li>
</ul>
</div>
<div class="middle_box">
<div class="middle_box_text_content">
<div class="middle_box_title"></div>
<p class="middle_text">
</p>
</div>
</div>
<div class="left_content">
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
%>
<div class="calendar_box">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<form method="post" action="loginprocess.jsp" >
<table>
<tr><td style="color:navy;"><B> Login Form</B></td></tr>
<tr><td>Category:</td><td><select name="category">
<option>Select a Category</option>
<option>Teacher</option>
<option>Student</option>
</select>
</td></tr>
<tr><td>User Name:</td><td><input type="text" name="username" /></td></tr>
<tr><td>Password:</td><td><input type="password" name="userpass"/></td></tr>
<tr><td></td><td><input type="submit" value="Sign in"/> <a href="register.jsp">Register</a></td></tr>
</table>
</form>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">23</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">23</div>
<div class="news_content">
<p><span></span>
we have latest projects uploaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,46 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="org.omg.CORBA.PUBLIC_MEMBER"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%
String username=request.getParameter("username");
System.out.print(username);
String userpass=request.getParameter("userpass");
String category=request.getParameter("category");
boolean status=false;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("select * from quizregister where username=? and userpass=? ");
ps.setString(1,username);
ps.setString(2,userpass);
ResultSet rs=ps.executeQuery();
status=rs.next();
if(status){
System.out.print("hi");
username=rs.getString(1);
session.setAttribute("username",String.valueOf(username));
session.setAttribute("islogin","plz sign in first");
session.setAttribute("category",category);
%>
<jsp:forward page="home.jsp"></jsp:forward>
<%
}
else{
System.out.print("hi");
request.setAttribute("Error","Sorry! Username or Password Error. plz Enter Correct Detail or Register");
session.setAttribute("Loginmsg","plz sign in first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
}
catch(Exception e){
e.printStackTrace();
}
%>

View File

@ -1,23 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<head>
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
----//body tags
<%
session.invalidate();
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
%>
<jsp:forward page="index.jsp"></jsp:forward>

View File

@ -1,149 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<jsp:include page="header.jsp"></jsp:include>
<%
String islogin=(String)session.getAttribute("islogin");
if(islogin==null){
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
%>
<div class="left_content">
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
if(session.getAttribute("category")!=null){
String category=(String)session.getAttribute("category");
if(category.equals("Student")){
request.setAttribute("category","You are not a Teacher,You can't make Quiz");
%>
<jsp:forward page="home.jsp"></jsp:forward>
<%
}
}
%>
<div class="calendar_box">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
<form method="post" action="createquiz.jsp" >
<table>
<tr><td>Subject:</td><td><input type="text" name="subject" /></td></tr>
<tr><td></td><td><input type="submit" value="Create"></td>
</table>
</form>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">1</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">2</div>
<div class="news_content">
<p><span></span>
we have latest projects uoloaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>
<jsp:include page="footer.html"></jsp:include>

View File

@ -1,30 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<%
try {
String name= request.getParameter("name");
String email= request.getParameter("email");
String phone= request.getParameter("phone");
String message= request.getParameter("message");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("insert into quizcontact values(?,?,?,?)");
ps.setString(1,name);
ps.setString(2,email);
ps.setString(3,phone);
ps.setString(4,message);
int s= ps.executeUpdate();
}
catch(Exception e){e.printStackTrace();}
%>
<jsp:forward page="home.jsp"></jsp:forward>

View File

@ -1,197 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Registration Form</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
var request;
function sendInfo()
{
var v=document.myform.username.value;
var url="findname.jsp?val="+v;
if(window.XMLHttpRequest){
request=new XMLHttpRequest();
}
else if(window.ActiveXObject){
request=new ActiveXObject("Microsoft.XMLHTTP");
}
try
{
request.onreadystatechange=getInfo;
request.open("GET",url,true);
request.send();
}
catch(e){alert("Unable to connect to server");}
}
function getInfo(){
if(request.readyState==4){
var val=request.responseText;
document.getElementById('location').innerHTML=val;
}
}
</script>
</head><body>
<div id="main_container">
<div class="main_content">
<div id="header">
</div>
<div class="top_center_box"></div>
<div class="center_box">
<div id="menu_tab">
<ul class="menu">
<li><a href="home.jsp" class="nav">Home</a></li>
<li class="divider"></li>
<li><a href="takequiz.jsp" class="nav">Take Quiz</a></li>
<li class="divider"></li>
<li><a href="ask.jsp" class="nav">Ask Ques.</a></li>
<li class="divider"></li>
<li><a href="makequiz.jsp" class="nav">Make quiz</a></li>
<li class="divider"></li>
<li><a href="contact.html" class="nav">Contact</a></li>
<li class="divider"></li>
<li><a href="register.jsp" class="nav">Registration</a></li>
</ul>
</div>
<div class="middle_box">
<div class="middle_box_text_content">
<div class="middle_box_title"></div>
<p class="middle_text">
</p>
</div>
</div>
<div class="left_content">
<div class="calendar_box">
<div class="calendar_box_content1">
<h1>Welcome to my Site</h1>
<p><div id="location"></div>
<form method="post" action="registerprocess.jsp" name="myform" >
<table>
<tr><td style="color:navy;"><B>Registration</B></td></tr>
<tr><td>User Name:</td><td><input type="text" name="username" onkeyup="sendInfo()"/></td></tr>
<tr><td>Password:</td><td><input type="password" name="userpass"/></td></tr>
<tr><td>Category:</td><td><select name="category">
<option>Select a Category</option>
<option>Teacher</option>
<option>Student</option>
</select>
</td></tr>
<tr><td>Email:</td><td><input type="text" name="email"/></td></tr>
<tr><td> </td>
<td><input type="submit" value="Register"></td></tr>
</table>
</form>
</p>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">23</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">23</div>
<div class="news_content">
<p><span></span>
we have latest projects uploaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,23 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<%try{
String username=request.getParameter("username");
String userpass=request.getParameter("userpass");
String category=request.getParameter("category");
String email=request.getParameter("email");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps=con.prepareStatement("insert into quizregister values(?,?,?,?)");
ps.setString(1,username);
ps.setString(2,userpass);
ps.setString(3,category);
ps.setString(4,email);
int s=ps.executeUpdate();
System.out.print(s);
}catch(SQLException e2){
e2.printStackTrace();
}
%>
<jsp:forward page="index.jsp"></jsp:forward>

View File

@ -1,151 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<html>
<jsp:include page="header.jsp"></jsp:include>
<%
String islogin=(String)session.getAttribute("islogin");
if(islogin==null){
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
%>
<div class="left_content">
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' >");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("finished")!=null){
out.print("<font size='2' color='navy'>");
out.print("<B>");
out.print(request.getAttribute("finished"));
out.print("<B>");
out.print("</font>");
}
%>
<div class="calendar_box">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
<form action="view.jsp">
<p>
<font style="color: navy;"><B>Your <%=request.getAttribute("total") %> questions are correct</B></font><BR/>
<input type="submit" value="view description">
</p>
</form>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">1</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">2</div>
<div class="news_content">
<p><span></span>
we have latest projects uploaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,47 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<%! static int counter=0; %>
<%
counter++;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
String question= request.getParameter("question");
String option1= request.getParameter("option1");
String option2= request.getParameter("option2");
String option3= request.getParameter("option3");
String option4= request.getParameter("option4");
String answer=request.getParameter("answer");
String description=request.getParameter("description");
PreparedStatement ps1=con.prepareStatement("select max(quizname) from quizinfo");
ResultSet rs=ps1.executeQuery();
while(rs.next()){
String quizname= rs.getString(1);
//System.out.print(quizname);
PreparedStatement ps=con.prepareStatement("insert into quizques values(?,?,?,?,?,?,?,?,?)");
ps.setString(1,question);
ps.setString(2,option1);
ps.setString(3,option2);
ps.setString(4,option3);
ps.setString(5,option4);
ps.setString(6,answer);
ps.setString(7,quizname);
ps.setString(8,null);
ps.setString(9,description);
int s= ps.executeUpdate();
}
}
catch(Exception e){e.printStackTrace();}
%>
<%
request.setAttribute("counter",counter);
%>
<jsp:forward page="createquiz1.jsp"></jsp:forward>

View File

@ -1,234 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<html>
<head>
<script>
var request;
function get1(){
window.location='get1.jsp';
}
function get(){
var v=document.getElementsByName('radio').value;
window.location="get.jsp?ans="+v;
}
function sendInfo()
{
var v=document.myform.subject.value;
var url="findname2.jsp?val="+v;
if(window.XMLHttpRequest){
request=new XMLHttpRequest();
}
else if(window.ActiveXObject){
request=new ActiveXObject("Microsoft.XMLHTTP");
}
try
{
request.onreadystatechange=getInfo;
request.open("GET",url,true);
request.send();
}
catch(e){alert("Unable to connect to server");}
}
function getInfo(){
if(request.readyState==4){
var val=request.responseText;
document.getElementById('location').innerHTML=val;
}
}
function viewAll(name)
{
var v=name;
var url="findname3.jsp?val="+v;
if(window.XMLHttpRequest){
request=new XMLHttpRequest();
}
else if(window.ActiveXObject){
request=new ActiveXObject("Microsoft.XMLHTTP");
}
try
{
request.onreadystatechange=viewInfo;
request.open("GET",url,true);
request.send();
}
catch(e){alert("Unable to connect to server");}
}
function viewInfo(){
if(request.readyState==4){
var val=request.responseText;
document.getElementById('location').innerHTML=val;
}
}
</script>
</head>
<jsp:include page="header.jsp"></jsp:include>
<%
String islogin=(String)session.getAttribute("islogin");
if(islogin==null){
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
%>
<div class="left_content">
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' >");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("finished")!=null){
out.print("<font size='2' color='navy'>");
out.print("<B>");
out.print(request.getAttribute("finished"));
out.print("<B>");
out.print("</font>");
}
%>
<div class="calendar_box2">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various sunject</B></marquee>
<form method="post" action="get1.jsp">
<table><tr><td>
<%
String question=(String)session.getAttribute("question");
String option1= (String)session.getAttribute("option1");
String option2= (String)session.getAttribute("option2");
String option3= (String)session.getAttribute("option3");
String option4= (String)session.getAttribute("option4");
out.print(question);
%>
<%
if((String)request.getParameter("radio")!=null){
String ans=(String)request.getParameter("radio");
System.out.println("ans on set"+ans);
session.setAttribute("ans",ans);
} %>
</td></tr>
<tr><td><input type="radio" name="radio" value="<%=option1%>" /><%=option1%></td></tr>
<tr><td><input type="radio" name="radio" value="<%=option2%>"/><%=option2 %></td></tr>
<tr><td><input type="radio" name="radio" value="<%=option3%>"/><%=option3 %></td></tr>
<tr><td><input type="radio" name="radio" value="<%=option4%>"/><%=option4 %></td></tr>
<tr><td></td><td><input type="submit" value="Next"/></td></tr>
</table>
</form>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">1</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">2</div>
<div class="news_content">
<p><span></span>
we have latest projects uploaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,294 +0,0 @@
body
{
background:url(images/bg.jpg) repeat-x top #fff;
padding:0;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10px;
margin:0px auto auto auto;
color:#416271;
}
p{
text-align:justify;
line-height:14px;
margin:0px;
}
span{
color:#7cb805;
}
a{
text-decoration:none;
color:#416271;
}
h1{
width:225px;
margin:0 0 5px 0;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#8c847a;
padding:5px 0 3px 0;
border-bottom:1px #CCCCCC dashed;
}
#main_container{
width:900px;
height:auto;
margin:auto;
padding:0px;
position:relative;
background:url(images/top_bg.jpg) no-repeat left top;
}
.main_content{
width:700px;
height:auto;
margin:auto;
}
.parrot{
position:absolute;
top:0px;
left:45px;
}
#header{
width:700px;
height:135px;
margin:auto;
}
.logo{
padding:55px 0 0 115px;
}
.top_center_box{
width:700px;
height:19px;
background:url(images/top_box.gif) no-repeat center;
}
.center_box{
width:700px;
background-color:#FFFFFF;
}
/*---------------- menu tab----------------------*/
#menu_tab{
width:700px;
height:51px;
font-family:Arial, Helvetica, sans-serif;
padding:0px;
margin:auto;
background:url(images/menu_bg.gif) no-repeat center;
}
ul.menu {
list-style-type:none; display:block; width:560px;
margin: auto; padding:0px; background:none;}
ul.menu li {
display:inline;
font-size:13px;
font-weight:bold;
line-height:51px;}
ul.menu li.divider {
display:block;
float:left;
width:1px;
height:51px;
padding:0px ;
margin:0px;
background:url(images/divider.gif) no-repeat center;
}
a.nav:link, a.nav:visited {
display:block; float:left; padding:0px; margin:0;width: auto; margin:0px 14px 0px 14px; text-align:center;
text-decoration:none; background:none; color:#62584d;}
a.nav_selected:link, a.nav_selected:visited {
display:block; float:left; padding:0px; margin:0;width: auto;margin:0px 14px 0px 14px;text-align:center;
text-decoration:none; color: #62584d; background:url(images/menu_arrow.gif) no-repeat top center;}
a.nav:hover {
color: #62584d; text-decoration:none;background:url(images/menu_arrow.gif) no-repeat top center;}
/*---------------middle_box-----------------*/
.middle_box{
width:654px;
height:161px;
background:url(images/center_box_bg.gif) no-repeat center;
margin:10px auto;
}
.middle_box_text_content{
width:335px;
height:auto;
}
.middle_box_title{
width:260px;
height:63px;
padding:5px;
}
p.middle_text{
padding:0 0 0 15px;
}
/*----------------left_content------------*/
.left_content{
width:345px;
float:left;
padding:10px;
}
.calendar_box{
width:329px;
background:url(images/calendar_bg.gif) no-repeat center;
}
.calendar_box2{
width:329px;
}
.calendar_box_content{
width:260px;
padding-left:53px;
}
.calendar_box_content1{
width:260px;
padding-left:40px;
height:230px;
}
.calendar_box_content2{
width:260px;
padding-left:40px;
height:400px;
}
.right_content{
width:310px;
float:left;
padding:10px 0 0 0;
}
.news_left{
padding:10px 0 0 10px;
}
.project_box{
clear:both;
padding:10px 0 15px 0;
}
.project_box_portofolio{
float:left;
padding:10px 15px 15px 15px;
}
img.left_img{
float:left;
padding:0 15px 0 0;
}
.news_box{
padding:5px 0 5px 0;
}
.calendar{
width:42px;
height:47px;
float:left;
background:url(images/calendar_icon.gif) no-repeat center;
text-align:center;
line-height:47px;
font-size:14px;
font-weight:bold;
color:#5d2c1a;
}
.news_content{
width:270px;
float:left;
padding:0 0 0 10px;
}
a.read_more{
width:75px;
height:29px;
display:block;
float:right;
margin:5px;
background:url(images/link_more_bg.gif) no-repeat center;
text-decoration:none;
color:#6c331f;
text-align:center;
line-height:29px;
}
a.read_more_a{
width:75px;
height:29px;
display:block;
float:right;
margin:5px;
background:url(images/link_more_bg_a.gif) no-repeat center;
text-decoration:none;
color:#dcc1b7;
text-align:center;
line-height:29px;
}
.wide_content{
width:660px;
clear:both;
padding:0 20px 0 20px;
}
.projects_navigation{
padding-right:250px;
}
p.contact_info{
padding:10px 0 0 20px;
line-height:18px;
}
span.orange{
color:#f89824;
}
/*-----------------------contact_form-------------------*/
#contact_form{
width:300px;
height:auto;
padding:10px 0 0 20px;
}
.form_row{
float:left;
padding:8px 0 8px 0;
}
label{
width:55px;
float:left;
padding:3px 5px 0 0;
color:#8ebb41;
text-align:right;
}
input.contact_input{
width:225px;
height:18px;
float:left;
border:1px #d1e0ee solid;
background-color:#eef4d7;
color: #000;
}
textarea.contact_textarea{
width:225px;
height:80px;
float:left;
border:1px #d1e0ee solid;
background-color:#eef4d7;
color: #000;
}
/*----------------------services-------------------------*/
.services{
float:left;
}
.services ul{
list-style:none;
padding:15px 10px 5px 0;
margin:0px;
}
.services ul li{
padding:5px;
}
.services ul li a{
background:url(images/arrow.gif) no-repeat left;
padding:0 0 0 25px;
text-decoration:none;
color:#416271;
}
/*--------------------footer--------------------*/
#footer{
width:680px;
height:16px;
clear:both;
color:#763c26;
padding:30px 0 0 20px;
background:url(images/footer_bg.gif) no-repeat center;
}

View File

@ -1,207 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<html>
<head>
<script>
var request;
function sendInfo()
{
var v=document.myform.subject.value;
var url="findname2.jsp?val="+v;
if(window.XMLHttpRequest){
request=new XMLHttpRequest();
}
else if(window.ActiveXObject){
request=new ActiveXObject("Microsoft.XMLHTTP");
}
try
{
request.onreadystatechange=getInfo;
request.open("GET",url,true);
request.send();
}
catch(e){alert("Unable to connect to server");}
}
function getInfo(){
if(request.readyState==4){
var val=request.responseText;
document.getElementById('location').innerHTML=val;
}
}
function viewAll(name)
{
var v=name;
var url="findname3.jsp?val="+v;
if(window.XMLHttpRequest){
request=new XMLHttpRequest();
}
else if(window.ActiveXObject){
request=new ActiveXObject("Microsoft.XMLHTTP");
}
try
{
request.onreadystatechange=viewInfo;
request.open("GET",url,true);
request.send();
}
catch(e){alert("Unable to connect to server");}
}
function viewInfo(){
if(request.readyState==4){
var val=request.responseText;
document.getElementById('location').innerHTML=val;
}
}
</script>
</head>
<jsp:include page="header.jsp"></jsp:include>
<%
String islogin=(String)session.getAttribute("islogin");
if(islogin==null){
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
%>
<div class="left_content">
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' >");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("finished")!=null){
out.print("<font size='2' color='navy'>");
out.print("<B>");
out.print(request.getAttribute("finished"));
out.print("<B>");
out.print("</font>");
}
%>
<div class="calendar_box2">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
<form method="post" name="myform" action="get.jsp">
Enter the subject:<input type="text" name="subject" onkeyup="sendInfo()"/>
<div id="location" ></div>
</form>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">1</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">2</div>
<div class="news_content">
<p><span></span>
we have latest projects uploaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

View File

@ -1,5 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<jsp:include page="header.jsp"></jsp:include>
<jsp:include page="footer.html"></jsp:include>

View File

@ -1,163 +0,0 @@
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<html>
<jsp:include page="header.jsp"></jsp:include>
<%
String islogin=(String)session.getAttribute("islogin");
if(islogin==null){
request.setAttribute("notlogin_msg","Sorry,Please do Login first");
%>
<jsp:forward page="index.jsp"></jsp:forward>
<%
}
%>
<div class="left_content">
<%
if(request.getAttribute("notlogin_msg")!=null){
out.print("<font size='2' color='red' m>");
out.print(request.getAttribute("notlogin_msg"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("Error")!=null){
out.print("<font size='2' color='red' >");
out.print(request.getAttribute("Error"));
out.print("</font>");
}
%>
<%
if(request.getAttribute("finished")!=null){
out.print("<font size='2' color='navy'>");
out.print("<B>");
out.print(request.getAttribute("finished"));
out.print("<B>");
out.print("</font>");
}
%>
<div class="calendar_box2">
<div class="calendar_box_content">
<h1>Welcome to my Site</h1>
<marquee direction="left" style="color: navy;" onmouseover="stop()" onmouseout="start()"><B>Assess Yourself by taking quizs on various subjects</B></marquee>
<%
String name=(String)session.getAttribute("quizname");
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps= con.prepareStatement("select * from quizques where quizname='"+name+"'");
ResultSet rs=ps.executeQuery();
out.print("<table>");
while(rs.next()){
out.print("<tr><td>Question:</td><td>"+rs.getString(1)+"</td></tr>");
out.print("<tr><td>Answer:</td><td>"+rs.getString(6)+"</td></tr>");
out.print("<tr><td>Description:</td><td>"+rs.getString(9)+"</td></tr>");
}
out.print("</table>");
}catch(Exception e){e.printStackTrace();}
%>
</div>
</div>
<div class="news_left">
<h1>Latest News</h1>
<div class="news_box">
<div class="calendar">1</div>
<div class="news_content">
<p><span></span>
now learn how to develop android application free of cost</p><br>
<a href="www.javatpoint.com" class="read_more">read more</a>
</div>
</div>
<br>
<div class="news_box">
<div class="calendar">2</div>
<div class="news_content">
<p><span></span>
we have latest projects uploaded on my site</p>
<a href="www.cstpoint.com" class="read_more">read more</a>
</div>
</div>
</div>
</div>
<!--end of left content-->
<div class="right_content">
<h1>Latest Projects</h1>
<div class="project_box">
<a href="#"><img src="images/p1.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Payment billing System
Online Quiz<br>
Matrimonial
</p>
</div>
<div class="project_box">
<a href="#"><img src="images/p2.gif" alt="" title="" class="left_img" border="0"></a>
<p>
<span> Description:</span><br>
Gmail Account<br>
Latest Quiz
</p>
</div>
<br>
<div>
<h1 ><br>Our main Services</h1>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
<div class="services">
<ul>
<li><a href="www.javatpoint.com">Java tutorial</a></li>
<li><a href="www.cstpoint.com">CSE tutorial</a></li>
</ul>
</div>
</div><!--end of right content-->
<div id="footer">
</div>
</div> <!--end of center box-->
</div> <!--end of main content-->
</div> <!--end of main container-->
</body></html>

21
module1/pom.xml Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonarqube</groupId>
<artifactId>sonarscanner-maven-aggregate</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>module1</artifactId>
<name>Module 1</name>
<properties>
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
</properties>
</project>

View File

@ -0,0 +1,17 @@
package com.acme.module1;
public class Module1 {
public void coveredByUnitTest() {
System.out.println("This method is covered by unit test");
}
public void coveredByIntegrationTest() {
System.out.println("This method is covered by integration test");
}
public void uncovered() {
System.out.println("This method is not covered");
}
}

View File

@ -0,0 +1,12 @@
package com.acme.module1;
import org.junit.Test;
public class Module1Test {
@Test
public void coveredByUnitTest() {
Module1 module1 = new Module1();
module1.coveredByUnitTest();
}
}

21
module2/pom.xml Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonarqube</groupId>
<artifactId>sonarscanner-maven-aggregate</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>module2</artifactId>
<name>Module 2</name>
<properties>
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
</properties>
</project>

View File

@ -0,0 +1,16 @@
package com.acme.module2;
public class Module2 {
public void coveredByUnitTest() {
System.out.println("This method is covered by unit test");
}
public void coveredByIntegrationTest() {
System.out.println("This method is covered by integration test");
}
public void uncovered() {
System.out.println("This method is not covered");
}
}

View File

@ -0,0 +1,11 @@
package com.acme.module2;
import org.junit.Test;
public class Module2Test {
@Test
public void coveredByUnitTest() {
new Module2().coveredByUnitTest();
}
}

87
pom.xml Normal file
View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sonarqube</groupId>
<artifactId>sonarscanner-maven-aggregate</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Example of multi-module Maven project</name>
<modules>
<module>module1</module>
<module>module2</module>
<module>tests</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<aggregate.report.dir>tests/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
</properties>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.1-jre</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.7.0.1746</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>coverage</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -1,58 +0,0 @@
package com.javatpoint;
import javax.servlet.*;
import java.sql.*;
public class MyListener implements ServletContextListener{
public void contextInitialized(ServletContextEvent arg0) {
Connection con=null;
try{
ResultSet rs;
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","oracle");
PreparedStatement ps1=con.prepareStatement("Select * from QUIZCONTACT");
rs=ps1.executeQuery();
if(rs.next())
{System.out.println("your table name already exist");}
else
{System.out.println("else if part table does not exist new table has created");
PreparedStatement ps2= con.prepareStatement("CREATE SEQUENCE JAVATPOINT MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE");
ps2.executeUpdate();
PreparedStatement ps=con.prepareStatement("CREATE TABLE QUIZCONTACT (NAME VARCHAR2(4000),EMAIL VARCHAR2(4000),PHONE VARCHAR2(4000),MESSAGE VARCHAR2(4000))");
ps.executeUpdate();
PreparedStatement ps4=con.prepareStatement("CREATE TABLE QUIZINFO (SUBJECT VARCHAR2(4000),QUIZNAME VARCHAR2(4000))");
ps4.executeUpdate();
PreparedStatement ps5=con.prepareStatement("CREATE TABLE QUIZQ(NAME VARCHAR2(4000),EMAIL VARCHAR2(4000),PHONE VARCHAR2(4000),QUESTION VARCHAR2(4000))");
ps5.executeUpdate();
ps5= con.prepareStatement("CREATE TABLE QUIZQUES(QUESTION VARCHAR2(4000),OPTION1 VARCHAR2(4000),OPTION2 VARCHAR2(4000),OPTION3 VARCHAR2(4000),OPTION4 VARCHAR2(4000),ANSWER VARCHAR2(4000),QUIZNAME VARCHAR2(4000),QID VARCHAR2(4000),DESCRIPTION VARCHAR2(4000),CONSTRAINT QUIZQUES_PK PRIMARY KEY (QID) ENABLE)");
ps5.executeUpdate();
ps5= con.prepareStatement("CREATE TABLE QUIZREGISTER (USERNAME VARCHAR2(4000),USERPASS VARCHAR2(4000),CATEGORY VARCHAR2(4000),EMAIL VARCHAR2(4000))");
ps5.executeUpdate();
Statement stmt=con.createStatement();
stmt.executeUpdate("CREATE TRIGGER BI_QUIZINFO before insert on QUIZINFO for each row begin select JAVATPOINT.nextval into :NEW.QUIZNAME from dual;end");
stmt.executeUpdate("CREATE TRIGGER BI_QUIZQUES before insert on QUIZQUES for each row begin select JAVATPOINT.nextval into :NEW.QID from dual;end");
}
}
catch(Exception e){
e.printStackTrace();
}
}
public void contextDestroyed(ServletContextEvent arg0) {
System.out.println("project undeployed");
}
}

51
tests/pom.xml Normal file
View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonarqube</groupId>
<artifactId>sonarscanner-maven-aggregate</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>tests</artifactId>
<properties>
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
</properties>
<name>Tests</name>
<dependencies>
<dependency>
<groupId>org.sonarqube</groupId>
<artifactId>module1</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.sonarqube</groupId>
<artifactId>module2</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,19 @@
package com.acme.its;
import com.acme.module1.Module1;
import com.acme.module2.Module2;
import org.junit.Test;
public class ModulesTest {
@Test
public void integrationTest1() {
new Module1().coveredByIntegrationTest();
}
@Test
public void integrationTest2() {
new Module2().coveredByIntegrationTest();
}
}