1 /* 2 * Copyright (C) 2008 The Android Open Source Project 3 * 4 * Licensed under the Eclipse Public License, Version 1.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.eclipse.org/org/documents/epl-v10.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ide.eclipse.mock; 18 19 import org.eclipse.core.resources.IContainer; 20 import org.eclipse.core.resources.IFile; 21 import org.eclipse.core.resources.IFolder; 22 import org.eclipse.core.resources.IMarker; 23 import org.eclipse.core.resources.IProject; 24 import org.eclipse.core.resources.IProjectDescription; 25 import org.eclipse.core.resources.IProjectNature; 26 import org.eclipse.core.resources.IResource; 27 import org.eclipse.core.resources.IResourceProxy; 28 import org.eclipse.core.resources.IResourceProxyVisitor; 29 import org.eclipse.core.resources.IResourceVisitor; 30 import org.eclipse.core.resources.IWorkspace; 31 import org.eclipse.core.resources.ResourceAttributes; 32 import org.eclipse.core.runtime.CoreException; 33 import org.eclipse.core.runtime.IPath; 34 import org.eclipse.core.runtime.IPluginDescriptor; 35 import org.eclipse.core.runtime.IProgressMonitor; 36 import org.eclipse.core.runtime.QualifiedName; 37 import org.eclipse.core.runtime.content.IContentTypeMatcher; 38 import org.eclipse.core.runtime.jobs.ISchedulingRule; 39 40 import sun.reflect.generics.reflectiveObjects.NotImplementedException; 41 42 import java.net.URI; 43 import java.util.Map; 44 45 /** 46 * Mock implementation of {@link IProject}. 47 * <p/>Supported methods: 48 * <ul> 49 * <li>{@link #build(int kind, IProgressMonitor monitor)}</li> 50 * <li>{@link #members(int kind, String builderName, Map args, IProgressMonitor monitor)}</li> 51 * </ul> 52 */ 53 @SuppressWarnings("deprecation") 54 public class ProjectMock implements IProject { 55 build(int kind, IProgressMonitor monitor)56 public void build(int kind, IProgressMonitor monitor) throws CoreException { 57 // pass 58 } 59 60 @SuppressWarnings("unchecked") build(int kind, String builderName, Map args, IProgressMonitor monitor)61 public void build(int kind, String builderName, Map args, IProgressMonitor monitor) 62 throws CoreException { 63 // pass 64 } 65 66 // -------- UNIMPLEMENTED METHODS ---------------- 67 68 close(IProgressMonitor monitor)69 public void close(IProgressMonitor monitor) throws CoreException { 70 throw new NotImplementedException(); 71 } 72 create(IProgressMonitor monitor)73 public void create(IProgressMonitor monitor) throws CoreException { 74 throw new NotImplementedException(); 75 } 76 create(IProjectDescription description, IProgressMonitor monitor)77 public void create(IProjectDescription description, IProgressMonitor monitor) 78 throws CoreException { 79 throw new NotImplementedException(); 80 } 81 delete(boolean deleteContent, boolean force, IProgressMonitor monitor)82 public void delete(boolean deleteContent, boolean force, IProgressMonitor monitor) 83 throws CoreException { 84 throw new NotImplementedException(); 85 } 86 getContentTypeMatcher()87 public IContentTypeMatcher getContentTypeMatcher() throws CoreException { 88 throw new NotImplementedException(); 89 } 90 getDescription()91 public IProjectDescription getDescription() throws CoreException { 92 throw new NotImplementedException(); 93 } 94 getFile(String name)95 public IFile getFile(String name) { 96 throw new NotImplementedException(); 97 } 98 getFolder(String name)99 public IFolder getFolder(String name) { 100 throw new NotImplementedException(); 101 } 102 getNature(String natureId)103 public IProjectNature getNature(String natureId) throws CoreException { 104 throw new NotImplementedException(); 105 } 106 getPluginWorkingLocation(IPluginDescriptor plugin)107 public IPath getPluginWorkingLocation(IPluginDescriptor plugin) { 108 throw new NotImplementedException(); 109 } 110 getReferencedProjects()111 public IProject[] getReferencedProjects() throws CoreException { 112 throw new NotImplementedException(); 113 } 114 getReferencingProjects()115 public IProject[] getReferencingProjects() { 116 throw new NotImplementedException(); 117 } 118 getWorkingLocation(String id)119 public IPath getWorkingLocation(String id) { 120 throw new NotImplementedException(); 121 } 122 hasNature(String natureId)123 public boolean hasNature(String natureId) throws CoreException { 124 throw new NotImplementedException(); 125 } 126 isNatureEnabled(String natureId)127 public boolean isNatureEnabled(String natureId) throws CoreException { 128 throw new NotImplementedException(); 129 } 130 isOpen()131 public boolean isOpen() { 132 throw new NotImplementedException(); 133 } 134 move(IProjectDescription description, boolean force, IProgressMonitor monitor)135 public void move(IProjectDescription description, boolean force, IProgressMonitor monitor) 136 throws CoreException { 137 throw new NotImplementedException(); 138 } 139 open(IProgressMonitor monitor)140 public void open(IProgressMonitor monitor) throws CoreException { 141 throw new NotImplementedException(); 142 } 143 open(int updateFlags, IProgressMonitor monitor)144 public void open(int updateFlags, IProgressMonitor monitor) throws CoreException { 145 throw new NotImplementedException(); 146 } 147 setDescription(IProjectDescription description, IProgressMonitor monitor)148 public void setDescription(IProjectDescription description, IProgressMonitor monitor) 149 throws CoreException { 150 throw new NotImplementedException(); 151 } 152 setDescription(IProjectDescription description, int updateFlags, IProgressMonitor monitor)153 public void setDescription(IProjectDescription description, int updateFlags, 154 IProgressMonitor monitor) throws CoreException { 155 throw new NotImplementedException(); 156 } 157 exists(IPath path)158 public boolean exists(IPath path) { 159 throw new NotImplementedException(); 160 } 161 findDeletedMembersWithHistory(int depth, IProgressMonitor monitor)162 public IFile[] findDeletedMembersWithHistory(int depth, IProgressMonitor monitor) 163 throws CoreException { 164 throw new NotImplementedException(); 165 } 166 findMember(String name)167 public IResource findMember(String name) { 168 throw new NotImplementedException(); 169 } 170 findMember(IPath path)171 public IResource findMember(IPath path) { 172 throw new NotImplementedException(); 173 } 174 findMember(String name, boolean includePhantoms)175 public IResource findMember(String name, boolean includePhantoms) { 176 throw new NotImplementedException(); 177 } 178 findMember(IPath path, boolean includePhantoms)179 public IResource findMember(IPath path, boolean includePhantoms) { 180 throw new NotImplementedException(); 181 } 182 getDefaultCharset()183 public String getDefaultCharset() throws CoreException { 184 throw new NotImplementedException(); 185 } 186 getDefaultCharset(boolean checkImplicit)187 public String getDefaultCharset(boolean checkImplicit) throws CoreException { 188 throw new NotImplementedException(); 189 } 190 getFile(IPath path)191 public IFile getFile(IPath path) { 192 throw new NotImplementedException(); 193 } 194 getFolder(IPath path)195 public IFolder getFolder(IPath path) { 196 throw new NotImplementedException(); 197 } 198 members()199 public IResource[] members() throws CoreException { 200 throw new NotImplementedException(); 201 } 202 members(boolean includePhantoms)203 public IResource[] members(boolean includePhantoms) throws CoreException { 204 throw new NotImplementedException(); 205 } 206 members(int memberFlags)207 public IResource[] members(int memberFlags) throws CoreException { 208 throw new NotImplementedException(); 209 } 210 setDefaultCharset(String charset)211 public void setDefaultCharset(String charset) throws CoreException { 212 throw new NotImplementedException(); 213 } 214 setDefaultCharset(String charset, IProgressMonitor monitor)215 public void setDefaultCharset(String charset, IProgressMonitor monitor) throws CoreException { 216 throw new NotImplementedException(); 217 } 218 accept(IResourceVisitor visitor)219 public void accept(IResourceVisitor visitor) throws CoreException { 220 throw new NotImplementedException(); 221 } 222 accept(IResourceProxyVisitor visitor, int memberFlags)223 public void accept(IResourceProxyVisitor visitor, int memberFlags) throws CoreException { 224 throw new NotImplementedException(); 225 } 226 accept(IResourceVisitor visitor, int depth, boolean includePhantoms)227 public void accept(IResourceVisitor visitor, int depth, boolean includePhantoms) 228 throws CoreException { 229 throw new NotImplementedException(); 230 } 231 accept(IResourceVisitor visitor, int depth, int memberFlags)232 public void accept(IResourceVisitor visitor, int depth, int memberFlags) throws CoreException { 233 throw new NotImplementedException(); 234 } 235 clearHistory(IProgressMonitor monitor)236 public void clearHistory(IProgressMonitor monitor) throws CoreException { 237 throw new NotImplementedException(); 238 } 239 copy(IPath destination, boolean force, IProgressMonitor monitor)240 public void copy(IPath destination, boolean force, IProgressMonitor monitor) 241 throws CoreException { 242 throw new NotImplementedException(); 243 } 244 copy(IPath destination, int updateFlags, IProgressMonitor monitor)245 public void copy(IPath destination, int updateFlags, IProgressMonitor monitor) 246 throws CoreException { 247 throw new NotImplementedException(); 248 } 249 copy(IProjectDescription description, boolean force, IProgressMonitor monitor)250 public void copy(IProjectDescription description, boolean force, IProgressMonitor monitor) 251 throws CoreException { 252 throw new NotImplementedException(); 253 } 254 copy(IProjectDescription description, int updateFlags, IProgressMonitor monitor)255 public void copy(IProjectDescription description, int updateFlags, IProgressMonitor monitor) 256 throws CoreException { 257 throw new NotImplementedException(); 258 } 259 createMarker(String type)260 public IMarker createMarker(String type) throws CoreException { 261 throw new NotImplementedException(); 262 } 263 createProxy()264 public IResourceProxy createProxy() { 265 throw new NotImplementedException(); 266 } 267 delete(boolean force, IProgressMonitor monitor)268 public void delete(boolean force, IProgressMonitor monitor) throws CoreException { 269 throw new NotImplementedException(); 270 } 271 delete(int updateFlags, IProgressMonitor monitor)272 public void delete(int updateFlags, IProgressMonitor monitor) throws CoreException { 273 throw new NotImplementedException(); 274 } 275 deleteMarkers(String type, boolean includeSubtypes, int depth)276 public void deleteMarkers(String type, boolean includeSubtypes, int depth) 277 throws CoreException { 278 throw new NotImplementedException(); 279 } 280 exists()281 public boolean exists() { 282 throw new NotImplementedException(); 283 } 284 findMarker(long id)285 public IMarker findMarker(long id) throws CoreException { 286 throw new NotImplementedException(); 287 } 288 findMarkers(String type, boolean includeSubtypes, int depth)289 public IMarker[] findMarkers(String type, boolean includeSubtypes, int depth) 290 throws CoreException { 291 throw new NotImplementedException(); 292 } 293 findMaxProblemSeverity(String type, boolean includeSubtypes, int depth)294 public int findMaxProblemSeverity(String type, boolean includeSubtypes, int depth) 295 throws CoreException { 296 throw new NotImplementedException(); 297 } 298 getFileExtension()299 public String getFileExtension() { 300 throw new NotImplementedException(); 301 } 302 getFullPath()303 public IPath getFullPath() { 304 throw new NotImplementedException(); 305 } 306 getLocalTimeStamp()307 public long getLocalTimeStamp() { 308 throw new NotImplementedException(); 309 } 310 getLocation()311 public IPath getLocation() { 312 throw new NotImplementedException(); 313 } 314 getLocationURI()315 public URI getLocationURI() { 316 throw new NotImplementedException(); 317 } 318 getMarker(long id)319 public IMarker getMarker(long id) { 320 throw new NotImplementedException(); 321 } 322 getModificationStamp()323 public long getModificationStamp() { 324 throw new NotImplementedException(); 325 } 326 getName()327 public String getName() { 328 throw new NotImplementedException(); 329 } 330 getParent()331 public IContainer getParent() { 332 throw new NotImplementedException(); 333 } 334 getPersistentProperty(QualifiedName key)335 public String getPersistentProperty(QualifiedName key) throws CoreException { 336 throw new NotImplementedException(); 337 } 338 getProject()339 public IProject getProject() { 340 throw new NotImplementedException(); 341 } 342 getProjectRelativePath()343 public IPath getProjectRelativePath() { 344 throw new NotImplementedException(); 345 } 346 getRawLocation()347 public IPath getRawLocation() { 348 throw new NotImplementedException(); 349 } 350 getRawLocationURI()351 public URI getRawLocationURI() { 352 throw new NotImplementedException(); 353 } 354 getResourceAttributes()355 public ResourceAttributes getResourceAttributes() { 356 throw new NotImplementedException(); 357 } 358 getSessionProperty(QualifiedName key)359 public Object getSessionProperty(QualifiedName key) throws CoreException { 360 throw new NotImplementedException(); 361 } 362 getType()363 public int getType() { 364 throw new NotImplementedException(); 365 } 366 getWorkspace()367 public IWorkspace getWorkspace() { 368 throw new NotImplementedException(); 369 } 370 isAccessible()371 public boolean isAccessible() { 372 throw new NotImplementedException(); 373 } 374 isDerived()375 public boolean isDerived() { 376 throw new NotImplementedException(); 377 } 378 isLinked()379 public boolean isLinked() { 380 throw new NotImplementedException(); 381 } 382 isLinked(int options)383 public boolean isLinked(int options) { 384 throw new NotImplementedException(); 385 } 386 isLocal(int depth)387 public boolean isLocal(int depth) { 388 throw new NotImplementedException(); 389 } 390 isPhantom()391 public boolean isPhantom() { 392 throw new NotImplementedException(); 393 } 394 isReadOnly()395 public boolean isReadOnly() { 396 throw new NotImplementedException(); 397 } 398 isSynchronized(int depth)399 public boolean isSynchronized(int depth) { 400 throw new NotImplementedException(); 401 } 402 isTeamPrivateMember()403 public boolean isTeamPrivateMember() { 404 throw new NotImplementedException(); 405 } 406 move(IPath destination, boolean force, IProgressMonitor monitor)407 public void move(IPath destination, boolean force, IProgressMonitor monitor) 408 throws CoreException { 409 throw new NotImplementedException(); 410 } 411 move(IPath destination, int updateFlags, IProgressMonitor monitor)412 public void move(IPath destination, int updateFlags, IProgressMonitor monitor) 413 throws CoreException { 414 throw new NotImplementedException(); 415 } 416 move(IProjectDescription description, int updateFlags, IProgressMonitor monitor)417 public void move(IProjectDescription description, int updateFlags, IProgressMonitor monitor) 418 throws CoreException { 419 throw new NotImplementedException(); 420 } 421 move(IProjectDescription description, boolean force, boolean keepHistory, IProgressMonitor monitor)422 public void move(IProjectDescription description, boolean force, boolean keepHistory, 423 IProgressMonitor monitor) throws CoreException { 424 throw new NotImplementedException(); 425 } 426 refreshLocal(int depth, IProgressMonitor monitor)427 public void refreshLocal(int depth, IProgressMonitor monitor) throws CoreException { 428 throw new NotImplementedException(); 429 } 430 revertModificationStamp(long value)431 public void revertModificationStamp(long value) throws CoreException { 432 throw new NotImplementedException(); 433 } 434 setDerived(boolean isDerived)435 public void setDerived(boolean isDerived) throws CoreException { 436 throw new NotImplementedException(); 437 } 438 setLocal(boolean flag, int depth, IProgressMonitor monitor)439 public void setLocal(boolean flag, int depth, IProgressMonitor monitor) throws CoreException { 440 throw new NotImplementedException(); 441 } 442 setLocalTimeStamp(long value)443 public long setLocalTimeStamp(long value) throws CoreException { 444 throw new NotImplementedException(); 445 } 446 setPersistentProperty(QualifiedName key, String value)447 public void setPersistentProperty(QualifiedName key, String value) throws CoreException { 448 throw new NotImplementedException(); 449 } 450 setReadOnly(boolean readOnly)451 public void setReadOnly(boolean readOnly) { 452 throw new NotImplementedException(); 453 } 454 setResourceAttributes(ResourceAttributes attributes)455 public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { 456 throw new NotImplementedException(); 457 } 458 setSessionProperty(QualifiedName key, Object value)459 public void setSessionProperty(QualifiedName key, Object value) throws CoreException { 460 throw new NotImplementedException(); 461 } 462 setTeamPrivateMember(boolean isTeamPrivate)463 public void setTeamPrivateMember(boolean isTeamPrivate) throws CoreException { 464 throw new NotImplementedException(); 465 } 466 touch(IProgressMonitor monitor)467 public void touch(IProgressMonitor monitor) throws CoreException { 468 throw new NotImplementedException(); 469 } 470 471 472 @SuppressWarnings("unchecked") getAdapter(Class adapter)473 public Object getAdapter(Class adapter) { 474 throw new NotImplementedException(); 475 } 476 contains(ISchedulingRule rule)477 public boolean contains(ISchedulingRule rule) { 478 throw new NotImplementedException(); 479 } 480 isConflicting(ISchedulingRule rule)481 public boolean isConflicting(ISchedulingRule rule) { 482 throw new NotImplementedException(); 483 } 484 create(IProjectDescription description, int updateFlags, IProgressMonitor monitor)485 public void create(IProjectDescription description, int updateFlags, 486 IProgressMonitor monitor) throws CoreException { 487 throw new NotImplementedException(); 488 } 489 getPersistentProperties()490 public Map<?,?> getPersistentProperties() throws CoreException { 491 throw new NotImplementedException(); 492 } 493 getSessionProperties()494 public Map<?,?> getSessionProperties() throws CoreException { 495 throw new NotImplementedException(); 496 } 497 isDerived(int options)498 public boolean isDerived(int options) { 499 throw new NotImplementedException(); 500 } 501 isHidden()502 public boolean isHidden() { 503 throw new NotImplementedException(); 504 } 505 setHidden(boolean isHidden)506 public void setHidden(boolean isHidden) throws CoreException { 507 throw new NotImplementedException(); 508 } 509 isHidden(int options)510 public boolean isHidden(int options) { 511 throw new NotImplementedException(); 512 } 513 isTeamPrivateMember(int options)514 public boolean isTeamPrivateMember(int options) { 515 throw new NotImplementedException(); 516 } 517 } 518